跟着尚硅谷B站视频记的笔记 入门 go 编译和运行源代码 go build 编译源代码,生成可执行文件 go build -o newName.exe name.go go run 直接编译运行代码 godoc gofmt 格式化代码 1 遇到的问题 1.1 安装环境问题 换成国内源 go env -w GOPROXY=https://goproxy.cn,direct 1.2 报错 package XXX is not in GOROOT (X:\XXX\Go\src\XXX) 解决方法:go…
import "io/ioutil" func main() { content, err = iotuil.ReadFile("somefile.txt") // etc.. } => I guess this doesn't really answer your question, but if you want, you can actually call the methods without explicitly stating the packag…