当前位置:网站首页>GoLand 编写go程序
GoLand 编写go程序
2022-07-27 05:23:00 【lianyz1985】
GoLand 编写go程序
New->Project->Go,指定任意路径,创建go项目iris-demo;
File->New->Go File,输入server.go,创建go文件;
将以下代码拷贝至server.go
package main
import (
"github.com/kataras/iris/v12"
)
func main() {
app := iris.New()
app.Logger().SetLevel("debug")
app.Run(iris.Addr(":8080"))
}
在终端输入命令,初始化mode
go mod init iris-demo
在终端输入以下命令,下载依赖包
go get -u
如果导入包显示红色,且在External Libraries的Go Modules显示为空,查找.idea目录下的workspace.xml文件,增加以下代码
<component name="VgoProject">
<integration-enabled>true</integration-enabled>
<environment>
<map>
<entry key="GOPROXY" value="https://mirrors.aliyun.com/goproxy/" />
</map>
</environment>
</component>
问题解决。
边栏推荐
猜你喜欢

Stress performance test of website based on AB tool under Apache

Kaggle calls the custom module method

QGIS series (1) -qgis (server APACHE) win10 installation

gradle的安装配置及使用

Basic operation of database on terminal

Shell programming specifications and variables

keras-ocr实例测试

账号管理与权限

NFS简介和配置

iptables防火墙及SNAT和DNAT
随机推荐
KVM命令集管理虚拟机
ArcGIS for JS API (1) get all field names of FeatureLayer
DNS域名解析服务
Programming learning records - Lesson 7 [functions]
Shell脚本编写格式
QGIS series (1) -qgis (server APACHE) win10 installation
Array and subscript index
Common font and color settings of markdown documents
网络故障排查:用户VLAN下用户无法收到组播报文故障(IGMP Snooping)
If conditional statement of shell
DNS域名解析服务
ArcGIS for JS API entry series
C language - dynamic memory management
Using markdowm
反射器中getattr,hasattr,delattr,setattr的使用
Shell programming specifications and variables
接口测试流程及面试问题
shell编程规范与变量
torch加载自定义模型的问题
px4源码编译之 建立自己的程序模块