-
Notifications
You must be signed in to change notification settings - Fork 302
Description
Description
While rebuilding the project using the latest version of Go, with Go's official recommendation to use gomodule for initialization and building, we found that the build process fails due to mismatched module path.
The following error log was produced during the build process:
......
go: found github.com/fatih/color in github.com/fatih/color v1.17.0
go: github.com/koding/kite/kontrol imports
github.com/lann/squirrel: github.com/lann/[email protected]: parsing go.mod:
module declares its path as: github.com/Masterminds/squirrel
but was required as: github.com/lann/squirrel
Result
The build fails with errors related to mismatched module path.
The error dependency is github.com/lann/squirrel
.
Reason
The error log suggests module path declaration github.com/Masterminds/squirrel
in go.mod, which is inconsistent with import path github.com/lann/squirrel
.
Proposed Solution
To resolve this issue, we analyzed the project and identified the correct versions of the required dependencies.
The analysis shows that the correct declaration for the dependency is replace github.com/lann/squirrel => github.com/Masterminds/squirrel v1.5.4
. This version is the latest version of the dependency.
Consider adopting this suggested version to prevent other developers from encountering build failures when constructing the project.
This information can be documented in the README.md file or another relevant location.
Additional Suggestions
To ensure reproducible builds and align with the evolving trends of the Go programming language, it is recommended that the current project be migrated to the Go module mechanism.
Updating to the go module mechanism allows for managing third-party dependency versions through the go.mod file, which provides a centralized and consistent way to specify dependency constraints.
We have generated a go.mod
file with the correct versions of the third-party dependencies needed for this project.
The suggested go.mod
file is as follows:
require github.com/fatih/structs v0.0.0-20160505090436-e5ca5fe90dcf // indirect
replace github.com/coreos/bbolt => go.etcd.io/bbolt v1.3.4-0.20200106203124-126e837046b0
require github.com/lib/pq v1.8.1-0.20200908161135-083382b7e6fc
require github.com/grpc-ecosystem/grpc-gateway v1.11.0 // indirect
replace github.com/golang-jwt/jwt => github.com/golang-jwt/jwt/v4 v4.4.3-0.20220926140152-0c4e38798546
require github.com/golang/groupcache v0.0.0-20170421005642-b710c8433bd1 // indirect
require github.com/mitchellh/cli v0.0.0-20160201180959-82b28612c6ca
require github.com/koding/logging v0.0.0-20140310081431-fff4c160f6dd
require github.com/fatih/camelcase v0.0.0-20150419180113-207c404d5f91 // indirect
require github.com/koding/cache v0.0.0-20160107191205-704055ea875a
require github.com/soheilhy/cmux v0.0.0-20150730150307-0417b90d39e1 // indirect
// require github.com/coreos/etcd v3.0.0-beta.0
require github.com/jonboulle/clockwork v0.2.3 // indirect
require github.com/gogo/protobuf v0.0.0-20171108112821-3813b83578b9 // indirect
require github.com/satori/go.uuid v1.2.1-0.20180318171246-6b362869be00
require github.com/gorilla/mux v1.3.1-0.20170520225546-1856953e530e
require github.com/armon/go-radix v0.0.0-20140801015722-519c5dd5ae35 // indirect
require github.com/xiang90/probing v0.0.0-20150804093907-11caf1c32ca4 // indirect
require github.com/gorilla/websocket v1.5.4-0.20240706001204-3810b2346f49
replace github.com/koding/websocketproxy => github.com/pretty66/websocketproxy v0.0.0-20220126060410-1e223097ea51
require github.com/google/uuid v1.2.1-0.20210331013651-512b657a4288 // indirect
require github.com/modern-go/reflect2 v1.0.2 // indirect
replace github.com/codegangsta/cli => github.com/urfave/cli/v2 v2.5.1
require github.com/coreos/pkg v0.0.0-20150429235124-2a2612570bd1 // indirect
require github.com/prometheus/client_golang v1.20.4 // indirect
require github.com/fatih/color v0.0.0-20140505101153-51482a20c556
require github.com/tmc/grpc-websocket-proxy v0.0.0-20200323084225-164c3d803b65 // indirect
require github.com/coreos/go-systemd v0.0.0-20160628072614-de4ee2875b89 // indirect
require github.com/stretchr/testify v1.10.0 // indirect
require github.com/dgrijalva/jwt-go v3.0.1-0.20170316165535-fd360ca1aa50+incompatible
require github.com/grpc-ecosystem/go-grpc-prometheus v0.0.0-20180118105301-6bae80a9dfa0 // indirect
require github.com/json-iterator/go v1.1.12 // indirect
require github.com/igm/sockjs-go v0.0.0-20160309003853-23545cb0a627
require github.com/dustin/go-humanize v0.0.0-20160923163517-bd88f87ad3a4 // indirect
require github.com/coreos/go-semver v0.3.2-0.20230208192010-2cb858cb3f67 // indirect
require github.com/koding/multiconfig v0.0.0-20170701121558-7ab5923ac43f
require github.com/juju/ratelimit v1.0.2-0.20191001135536-4b7d3ddde4ec
require github.com/grpc-ecosystem/go-grpc-middleware v0.0.0-20171020063731-82921fcf811d // indirect
require github.com/hashicorp/go-version v1.2.1
require github.com/mattn/go-isatty v0.0.0-20150814002629-7fcbc72f853b // indirect
require (
github.com/cenkalti/backoff v2.2.1+incompatible
github.com/coreos/etcd v3.3.27+incompatible
github.com/golang/protobuf v1.5.0 // indirect
github.com/koding/websocketproxy v0.0.0-00010101000000-000000000000
github.com/lann/squirrel v0.0.0-00010101000000-000000000000
golang.org/x/crypto v0.31.0
)
require (
github.com/BurntSushi/toml v0.3.1 // indirect
github.com/bgentry/speakeasy v0.2.0 // indirect
github.com/bradfitz/http2 v0.0.0-20160116213329-aa7658c0e990 // indirect
github.com/coreos/bbolt v0.0.0-00010101000000-000000000000 // indirect
github.com/google/btree v1.1.3 // indirect
github.com/gorilla/context v1.1.2 // indirect
github.com/kr/pretty v0.3.1 // indirect
github.com/lann/builder v0.0.0-20180802200727-47ae307949d0 // indirect
github.com/lann/ps v0.0.0-20150810152359-62de8c46ede0 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/prometheus/common v0.62.0 // indirect
github.com/rogpeppe/go-internal v1.10.0 // indirect
github.com/sirupsen/logrus v1.9.3 // indirect
go.uber.org/zap v1.27.0 // indirect
golang.org/x/net v0.33.0 // indirect
golang.org/x/sys v0.28.0 // indirect
golang.org/x/term v0.27.0 // indirect
golang.org/x/time v0.10.0 // indirect
google.golang.org/grpc v1.19.0 // indirect
google.golang.org/protobuf v1.36.1 // indirect
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
sigs.k8s.io/yaml v1.4.0 // indirect
)
replace github.com/lann/squirrel => github.com/Masterminds/squirrel v1.5.4
Additional Information:
This issue was identified as part of our research project focused on automating the analysis of GOPATH projects to provide accurate dependency versions for seamless migration to Go Modules. We value your feedback and would appreciate any comments or suggestions regarding this approach.