克隆代码,编译
-
git config --global url."git@github.com:".insteadOf "https://github.com"
-
git checkout git@github.com:gomods/athens.git
-
git checkout release-v0.12.0
-
make build-ver VERSION="0.2.0"
-
vim Makefile
- GOPROXY="https://goproxy.cn,direct"
(base) robertdeair:athens robert$ ./athens -version
Build Details:
Version: 0.2.0
Date: 2023-07-30-12:31:50-UTC
(base) robertdeair:athens robert$ go env -w GOSUMDB=off
(base) robertdeair:athens robert$ ./athens -config_file=./config.dev.toml
- http://localhost:3000/
INFO[8:54PM]: Exporter not specified. Traces won't be exported
2023/07/30 20:54:52 Starting application at port :3000
INFO[8:55PM]: incoming request http-method=GET http-path=/github.com/athens-artifacts/samplelib/@v/v1.0.0.mod http-status=200 request-id=2b2f5fed-d200-4e4d-94f4-daf24207431a
INFO[8:55PM]: incoming request http-method=GET http-path=/github.com/athens-artifacts/samplelib/@v/v1.0.0.zip http-status=200 request-id=483dab9e-cdd9-4983-8518-7df3fbc66b78
INFO[8:55PM]: incoming request http-method=GET http-path=/github.com/athens-artifacts/samplelib/@v/v1.0.0.info http-status=200 request-id=1f0fb234-d70e-49e2-b5a2-4b272c6f7f2b
git clone git@github.com:athens-artifacts/walkthrough.git
cd walkthrough
export GOPROXY=http://localhost:3000
go env
go run main.go
(base) robertdeair:walkthrough robert$ go run main.go
go: downloading github.com/athens-artifacts/samplelib v1.0.0
The 🦁 says rawr!
(base) robertdeair:walkthrough robert$ tree ../athens-storage/
../athens-storage/
└── github.com
└── athens-artifacts
└── samplelib
└── v1.0.0
├── go.mod
├── source.zip
└── v1.0.0.info
5 directories, 3 files
私服代码同步
- 拷贝 ../athens-storage/ 里的代码到不能上网的服务器
网友评论