Go 是一个开源的编程语言,它能让构造简单、可靠且高效的软件变得容易。

Go是从2007年末由Robert Griesemer, Rob Pike, Ken Thompson主持开发,后来还加入了Ian Lance Taylor, Russ Cox等人,并最终于2009年11月开源,在2012年早些时候发布了Go 1稳定版本。现在Go的开发已经是完全开放的,并且拥有一个活跃的社区。

go.dev.webp

下载适用于 Windows 的 Go

教程:开始使用 Go

  • 用于编辑代码的工具。您拥有的任何文本编辑器都可以正常工作。大多数文本编辑器都对 Go 有很好的支持。最受欢迎的是 VSCode(免费)、GoLand(付费)和 Vim(免费)。

使用 VSCode 新建 hello.go ,点击 Run Code 运行

package main

import "fmt"

func main() {
    fmt.Println("Hello, 世界")
}

VSCode 安装Go语言开发工具包,在开发过程中可以提供代码提示,自动补全功能。

go.webp

配置代理:由于国内网络的原因,对于一些golang的开发包下载不成功

PATH.png

# 安装程序自动添加
GOPATH = %USERPROFILE%go

# 添加系统变量
GO111MODULE = auto
GOPROXY = https://goproxy.cn,direct

ctrl + shift +p 在搜素框中输入 go:install 选择 Go:Install/Update Tools 点击,如图:

AA.gif

正确安装插件工具输出提示

Tools environment: GOPATH=C:Usersvipgo
Installing 7 tools at C:Usersvipgoin in module mode.
  gotests
  gomodifytags
  impl
  goplay
  dlv
  staticcheck
  gopls

Installing github.com/cweill/gotests/gotests@latest (C:Usersvipgoingotests.exe) SUCCEEDED
Installing github.com/fatih/gomodifytags@latest (C:Usersvipgoingomodifytags.exe) SUCCEEDED
Installing github.com/josharian/impl@latest (C:Usersvipgoinimpl.exe) SUCCEEDED
Installing github.com/haya14busa/goplay/cmd/goplay@latest (C:Usersvipgoingoplay.exe) SUCCEEDED
Installing github.com/go-delve/delve/cmd/dlv@latest (C:Usersvipgoindlv.exe) SUCCEEDED
Installing honnef.co/go/tools/cmd/staticcheck@latest (C:Usersvipgoinstaticcheck.exe) SUCCEEDED
Installing golang.org/x/tools/gopls@latest (C:Usersvipgoingopls.exe) SUCCEEDED

All tools successfully installed. You are ready to Go. :)
分类: 学习编程

0 条评论

发表回复

Avatar placeholder

您的电子邮箱地址不会被公开。 必填项已用 * 标注

© 2024 兰雅VBA代码分享
浙ICP备2021017795号-2 浙公网安备33078102100266号