1.配置开发环境
1.1下载Go并安装
官网https://golang.google.cn/dl/
![](https://img-community.csdnimg.cn/images/1c5b42e3a0ec444e989cf88dda3724db.png)
安装完成,并查看版本。
![](https://img-community.csdnimg.cn/images/2dd8800e0278408db1846595e75dc233.png)
1.2打开VScode安装Go插件
![](https://img-community.csdnimg.cn/images/f331562a08954ffa8f50dca632e96d10.png)
2.编写menu程序
2.1menu程序
package main
import "fmt"
func main() {
fmt.Println("welcome to menu,please input \"help\" for help ")
for {
var cmd string
fmt.Println(">>")
fmt.Scanln(&cmd)
if cmd == "help" {
fmt.Println("hello---print hello")
fmt.Println("help---show menu")
fmt.Println("quit---quit menu")
} else if cmd == "hello" {
fmt.Println("hello 483")
} else if cmd == "quit" {
fmt.Println("bye")
break
} else {
fmt.Println("error,please input 'help' for help")
}
}
}
2.2结果如下
![](https://img-community.csdnimg.cn/images/1d04a0ddeb854bb5b872245445214dd4.png)
3.上传Gitee
![](https://img-community.csdnimg.cn/images/823381682a6743adb4b7495e3b18bc97.png)
![](https://img-community.csdnimg.cn/images/8fafbf31cce54889a92363a66d61e348.png)
推送成功
![](https://img-community.csdnimg.cn/images/e2fb7138d36c49a3b080ceaf34576ef8.png)
学号:483
|