企业🤖AI智能体构建引擎,智能编排和调试,一键部署,支持私有化部署方案 广告
# go语言 - windows下安装<https://studygolang.com/dl> <https://mirrors.aliyun.com/goproxy/> 阿里云代理 查看版本 `go version` 查看配置 `go env` `set GOPROXY=https://goproxy.cn,direct` `set GO111MODULE=on` 设置到 C:\\gowork\\bin GOROOT环境变量C:\\app\\go GOPATH环境变量C:\\www\\go ``` <pre class="calibre14">``` package main import <span class="token4">"fmt"</span> func <span class="token1">main</span><span class="token2">(</span><span class="token2">)</span> <span class="token2">{</span> fmt<span class="token2">.</span><span class="token1">Println</span><span class="token2">(</span><span class="token4">"Hello, World!"</span><span class="token2">)</span> <span class="token2">}</span> ``` ``` cmd中 运行 `go run hello.go` 编译go `go build hello.go`成exe文件 目录结构 src放置源码 - 安装govendor ``` <pre class="calibre16">``` go get –u <span class="token">-</span>v github<span class="token2">.</span>com<span class="token">/</span>kardianos<span class="token">/</span>govendor go get <span class="token">-</span>u github<span class="token2">.</span>com<span class="token">/</span>kardianos<span class="token">/</span>govendor <span class="token6">//编译命令</span> cd 到src<span class="token">/</span>hello目录 govendor init ``` ```