# Study Go **Repository Path**: Astro-Lee/studyGo ## Basic Information - **Project Name**: Study Go - **Description**: 学习Go语言时写的一些代码 Modules https://gitee.com/Astro-Lee/gogreetings https://gitee.com/Astro-Lee/gogin - **Primary Language**: Go - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2022-02-09 - **Last Updated**: 2022-08-15 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # 学习Go语言时写的一些代码 ## Resource [Official Website](https://golang.google.cn/) [Official Documentation](https://golang.google.cn/doc/) **官方文档是最好的学习资料** [学习视频1](https://www.bilibili.com/video/BV1FV411r7m8) [学习博客](https://www.liwenzhou.com/posts/Go/golang-menu/) [学习视频2](https://www.bilibili.com/video/BV1e54y1Q7mp) [Go语言实战](https://space.bilibili.com/1557732/video) ## 设置代理 无法正常访问 Google 的网络环境,依赖无法被正常拉取,需要先设置 `GOPROXY`: ```bash go env -w GOPROXY=https://goproxy.io,direct ``` 下载[Golang tools](https://github.com/golang/tools) ```bash go install golang.org/x/tools/...@latest ``` ## 跨平台编译 **Linux** 下编译Mac和Windows平台的64位可执行程序 ```bash CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 go build CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build ``` **MacOS** 下编译Linux和Windows平台的64位可执行程序 ```bash CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build ``` **Windows** 下编译Linux和Windows平台的64位可执行程序 &&前不能有空格 ```bash SET CGO_ENABLED=0&& SET GOOS=linux&& SET GOARCH=amd64&& go build SET CGO_ENABLED=0&& SET GOOS=darwin&& SET GOARCH=amd64&& go build ```