mirror of https://github.com/goproxyio/goproxy
修复CI死锁
parent
64117b2669
commit
ae73e81ba0
|
@ -5,6 +5,7 @@ A global proxy for go modules. see: [https://goproxy.io](https://goproxy.io)
|
||||||
|
|
||||||
## Requirements
|
## Requirements
|
||||||
It invokes the local go command to answer requests.
|
It invokes the local go command to answer requests.
|
||||||
|
The default cacheDir is GOPATH, you can set it up by yourself according to the situation.
|
||||||
|
|
||||||
## Build
|
## Build
|
||||||
git clone https://github.com/goproxyio/goproxy.git
|
git clone https://github.com/goproxyio/goproxy.git
|
||||||
|
@ -18,6 +19,9 @@ A global proxy for go modules. see: [https://goproxy.io](https://goproxy.io)
|
||||||
|
|
||||||
./bin/goproxy -listen=0.0.0.0:80 -cacheDir=/tmp/test
|
./bin/goproxy -listen=0.0.0.0:80 -cacheDir=/tmp/test
|
||||||
|
|
||||||
|
If you run `go get -v pkg` in the proxy machine, shuold set a new GOPATH which is not different from the old GOPATH, or mayebe deadlock.
|
||||||
|
See the file test/get_test.sh.
|
||||||
|
|
||||||
### Router mode
|
### Router mode
|
||||||
|
|
||||||
Use the -proxy flag switch to "Router mode", which
|
Use the -proxy flag switch to "Router mode", which
|
||||||
|
|
2
main.go
2
main.go
|
@ -174,7 +174,7 @@ func (*ops) List(ctx context.Context, mpath string) (proxy.File, error) {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
file := filepath.Join(downloadRoot, escMod+"/@v/listproxy")
|
file := filepath.Join(downloadRoot, escMod+"/@v/list")
|
||||||
if info, err := os.Stat(file); err == nil && time.Since(info.ModTime()) < listExpire {
|
if info, err := os.Stat(file); err == nil && time.Since(info.ModTime()) < listExpire {
|
||||||
return os.Open(file)
|
return os.Open(file)
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
|
|
||||||
export GO111MODULE=on
|
export GO111MODULE=on
|
||||||
export GOPROXY='http://127.0.0.1:8081'
|
export GOPROXY='http://127.0.0.1:8081'
|
||||||
|
export GOPATH=/tmp/go
|
||||||
|
|
||||||
datafile='test/testdata/get.txt'
|
datafile='test/testdata/get.txt'
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue