最新消息:20210816 当前crifan.com域名已被污染,为防止失联,请关注(页面右下角的)公众号

【记录】go语言的基本开发:实现Hello World,找到合适的开发环境和工具

GO crifan 2452浏览 0评论

【背景】

折腾:

【记录】用go语言实现模拟登陆百度

期间,已经:

【记录】下载和安装go语言

了,现在继续去,弄出hello world,并且找到合适的开发环境和工具。

以便于以后的继续深入开发go。

【折腾过程】

1.参考官网文档:

http://golang.org/doc/

去看看如何开发。

2.还是老实点,一点点看吧:

http://golang.org/doc/install

3.安装go之后,去设置环境变量:

right click computer property

advanced system configuration for win7

advanced environment variables

system variable path edit

add go install bin path into path

即:

PATH=E:\dev_install_root\Go\bin

加到系统的PATH中。

4.然后用Notepad++去写个hello.go,内容如下:

package main

import "fmt"

func main() {
    fmt.Printf("hello, world\n")
}

如图:

hello go content

然后去cmd中编译:

打开cmd:

right click to open cmd under win7

运行:

go run hello.go

输出为:

E:\Dev_Root\go\hello>go run hello.go
hello, world

E:\Dev_Root\go\hello>

如图:

go run hello go effect

至此,hello world搞定了。

5.另外,看了看:

How to Write Go Code

给了例子,说明如何写自己的库函数,需要的时候,可以去看看。

6.关于后续开发,可参考:

http://code.google.com/p/go-tour/

中的:

http://tour.golang.org/#1

然后再一点点跟着教程学习基本的东西。

7.其他常见问题,可以参考:

Frequently Asked Questions (FAQ)

8.接下来,去找找,是不是有更好的开发环境。

结果是:

目前,凑合暂时还是用Notepad++吧。。。

 

【总结】

知道基本的go的开发,剩下就是,多看看官网稳定,搞懂基本概念,继续深入开发go了。

转载请注明:在路上 » 【记录】go语言的基本开发:实现Hello World,找到合适的开发环境和工具

发表我的评论
取消评论

表情

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址
82 queries in 0.274 seconds, using 22.12MB memory