ThinkSSL🔒 一键申购 5分钟快速签发 30天无理由退款 购买更放心 广告
## 安装 Mix Go > 安装开发工具,两种方法二选一 使用 `go get` 安装,优点是可以使用代理加速。 ~~~ // 快速安装 go get github.com/mix-go/mix // 如果安装时提示版本异常,增加 -u 参数 go get -u github.com/mix-go/mix // 也可以安装 master 分支的最新代码 go get -u github.com/mix-go/mix@master ~~~ 源码安装 ~~~ git clone https://github.com/mix-go/mix cd mix go install ~~~ ## 创建项目 创建应用骨架 > 当提示 go get *** 异常时,手动执行重试一下,还无法解决就截图去官方群 - console ~~~ mix new --name=hello ~~~ - api ~~~ mix api --name=hello ~~~ - web (含websocket) ~~~ mix web --name=hello ~~~ - grpc ~~~ mix grpc --name=hello ~~~ ## 编译 >[danger] 使用 `Goland` 的用户在编辑器中使用 `Run` 菜单替代下面的过程 - 编译到骨架的 `bin` 目录,**注意:必须编译到该目录,Goland 默认是编译到缓存目录,这样会读取不到 .env 等配置文件而抛出异常。** ~~~ cd hello go build -o bin/go_build_main_go main.go ~~~ - 执行 Win ~~~ cd bin go_build_main_go.exe ~~~ Linux & macOS ~~~ cd bin ./go_build_main_go ~~~