552
社区成员
在这里下载适用于Windows环境的Go语言安装包:
安装完成后打开cmd窗口输入命令查看是否安装成功:
go version
go version go1.20.2 windows/amd64
go env -m GOPROXY=https://goproxy.cn,direct
在VS Code中搜索Go并安装Go扩展:
在项目中新建main.go文件并输入代码:
package main
import "fmt"
func main() {
var cmd string
for {
fmt.Print("Please input a command: ")
fmt.Scanln(&cmd)
switch cmd {
case "help":
fmt.Println("This is help command.")
case "quit":
fmt.Println("Bye.")
return
default:
fmt.Println("Wrong command!")
}
}
}
运行结果:
推送到远程仓库
git add .
git commit -m "first commit"
git push -u origin "master"
仓库:
学号后三位:164