556
社区成员




将仓库clone到本地
官网https://golang.google.cn/dl/下载安装,选择windows版本
验证go已经安装成功
package main
import (
"fmt"
"os"
)
// dlv debug --headless --listen=:2345
func main() {
var cmdline string
fmt.Println("WelCome to The Machine")
fmt.Println("#*********# Go_MENU v0.1 #*********#")
fmt.Println("help: User Manual || list: List Page")
fmt.Println("setup: Setup Page || quit: QUIT")
fmt.Println("And some hidden words")
fmt.Println("####################################")
for true {
fmt.Println("\n#*********# Go_MENU v0.1 #*********#")
fmt.Scan(&cmdline)
switch cmdline {
case "help":
fmt.Println("How can I help you?")
break
case "list":
fmt.Println("Hurry up to make your choise!")
break
case "setup":
fmt.Println("Watch up where you going")
break
case "quit":
fmt.Println("OK OK I'm done.")
os.Exit(0)
case "canyouhearme":
fmt.Println("Hell yes")
break
case "nut":
fmt.Println("I could be bounded in a nutshell and count myself a king of infinite space.")
fmt.Println("https://github.com/phantomT/T-Shell")
break
default:
fmt.Println("HAHA, VERY FUNNY, DO THAT AGAIN")
}
}
}
编译过程中发现还需要安装其他插件,出现The “go-outline” command is not available. Run “go install -v github.com/ramya-rao-a/go-outline@latest” to install.报错经过百度发现需要改变插件的下载安装的代理地址,解决方法为:
$ go env -w GO111MODULE=on
$ go env -w GOPROXY=https://goproxy.io,direct
问题成功解决,最终运行结果为:
学号后三位:240