0
点赞
收藏
分享

微信扫一扫

Go开发环境搭建以及Goland的使用

Spinach菠菜 2022-02-09 阅读 48

下载

方式一

官网下载Downloads - The Go Programming Language

方式二

中文网Go下载 - Go语言中文网 - Golang中文社区

Windows安装

弹窗

 

解决:下载1.16.13版本进行安装

 

 

 

 

 

测试安装

环境变量:新版本安装包安装的时候会自动添加环境变量

已经添加了GoPath

在cmd窗口输入 go version

新建hell.go

package main

func main() {

    println("Hello", "world")

}

Cmd 输入命令 go run hell.go

Goland安装

 

 

 

 

GoLand创建项目

 

添加hello.go

package GoWorkSpace

func main()  {

       println("hello","world")

}

右键 Run

问题:

解决

源码需要建立在src目录下, 启动入口包名需要是main

修改

package main

func main()  {

       println("hello","world")

}

举报

相关推荐

0 条评论