[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Some random notes for Go mod implementation



I did some random test, but haven't thought carefully.

Take one package src:elvish for example(since the build-depends is
really simple)

1. Remove origin go.mod go.sum
2. Create a new go.mod

```
module github.com/elves/elvish

require (
       github.com/boltdb/bolt v0.0.0
       github.com/kr/pty v0.0.0
       github.com/xiaq/persistent v0.0.0
       golang.org/x/sys v0.0.0
)

replace (
       github.com/boltdb/bolt => /usr/share/gocode/src/github.com/boltdb/bolt
       github.com/kr/pty => /usr/share/gocode/src/github.com/kr/pty
       github.com/xiaq/persistent =>
/usr/share/gocode/src/github.com/xiaq/persistent
       golang.org/x/sys => /usr/share/gocode/src/golang.org/x/sys/
)

go 1.12
```

3. One build-depends has no go.mod file

```
# cat << EOF > /usr/share/gocode/src/github.com/boltdb/bolt/go.mod
module github.com/boltdb/bolt
EOF
```

4. Build

GO111MODULE=on GOPROXY=off GOSUMDB=off go build  -v ./

-- 
Shengjing Zhu


Reply to: