oligot / go-mod-upgrade

Update outdated Go dependencies interactively
MIT License
905 stars 43 forks source link

can't do mod upgrade when upgrade to v0.9.0 #32

Closed bighunter513 closed 2 years ago

bighunter513 commented 2 years ago

when use go-mod-upgrade@v0.9.0:
• Using directory dir=/xxx/xxx/project ⨯ upgrade failed error=Error running go command to discover modules: exit status 1 stderr=go: can't determine available upgrades using the vendor directory (Use -mod=mod or -mod=readonly to bypass.)

when rollback to v0.8.0, everything is ok.

oligot commented 2 years ago

Hi,

Can you share a small repo, or at least the go.mod so that I can reproduce the bug on my side ?

Thanks !

bighunter513 commented 2 years ago

Hi,

Can you share a small repo, or at least the go.mod so that I can reproduce the bug on my side ?

Thanks !

module myproject

go 1.18

require ( bou.ke/monkey v1.0.2 cloud.google.com/go/bigtable v1.15.0 github.com/apache/rocketmq-client-go/v2 v2.1.0 github.com/apache/thrift v0.16.0 github.com/d5/tengo/v2 v2.12.0 github.com/dvyukov/go-fuzz v0.0.0-20220220162807-a217d9bdbece github.com/emirpasic/gods v1.18.1 github.com/getsentry/sentry-go v0.13.0 github.com/go-eden/common v0.1.14 github.com/go-redis/redis/v8 v8.11.5 github.com/go-sql-driver/mysql v1.6.0 github.com/gogo/protobuf v1.3.2 github.com/golang/mock v1.6.0 github.com/golang/protobuf v1.5.2 github.com/google/gofuzz v1.2.0 github.com/gorilla/websocket v1.5.0 github.com/ianlancetaylor/cgosymbolizer v0.0.0-20220405231054-a1ae3e4bba26 github.com/jinzhu/copier v0.3.5 github.com/json-iterator/go v1.1.12 github.com/konsorten/go-windows-terminal-sequences v1.0.3 github.com/lestrrat-go/file-rotatelogs v2.4.0+incompatible github.com/logrusorgru/aurora v2.0.3+incompatible github.com/magefile/mage v1.13.0 github.com/mattn/go-sqlite3 v1.14.14 github.com/mitchellh/mapstructure v1.5.0 github.com/oklog/oklog v0.3.2 github.com/opentracing/opentracing-go v1.2.0 github.com/panjf2000/ants/v2 v2.5.0 github.com/peterh/liner v1.2.2 github.com/petermattis/goid v0.0.0-20220712135657-ac599d9cba15 github.com/phayes/freeport v0.0.0-20220201140144-74d24b5ae9f5 github.com/pkg/errors v0.9.1 github.com/prometheus/client_golang v1.12.2 github.com/samber/lo v1.25.0 github.com/sanity-io/litter v1.5.5 github.com/segmentio/stats/v4 v4.6.3 github.com/smallnest/queue v0.0.0-20220611141810-0d9f5317dd58 github.com/smartystreets/goconvey v1.7.2 github.com/spf13/cast v1.5.0 github.com/spf13/viper v1.12.0 github.com/streadway/amqp v1.0.0 github.com/traefik/yaegi v0.13.0 github.com/uber/jaeger-client-go v2.30.0+incompatible github.com/ulule/deepcopier v0.0.0-20200430083143-45decc6639b6 github.com/yireyun/go-queue v0.0.0-20210520035143-72b190eafcba github.com/yuin/gopher-lua v0.0.0-20220504180219-658193537a64 github.com/zhnxin/csvreader v0.0.0-20190606083136-f9e31b1bce61 go.etcd.io/etcd/api/v3 v3.5.4 go.etcd.io/etcd/client/v3 v3.5.4 go.opencensus.io v0.23.0 go.uber.org/atomic v1.9.0 go.uber.org/multierr v1.8.0 go.uber.org/zap v1.21.0 golang.org/x/exp v0.0.0-20220713135740-79cabaa25d75 golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4 golang.org/x/net v0.0.0-20220708220712-1185a9018129 golang.org/x/tools v0.1.11 google.golang.org/grpc v1.48.0 )

require ( cloud.google.com/go v0.102.1 // indirect cloud.google.com/go/compute v1.7.0 // indirect cloud.google.com/go/iam v0.3.0 // indirect github.com/HdrHistogram/hdrhistogram-go v1.1.2 // indirect github.com/beorn7/perks v1.0.1 // indirect github.com/census-instrumentation/opencensus-proto v0.3.0 // indirect github.com/cespare/xxhash/v2 v2.1.2 // indirect github.com/cncf/udpa/go v0.0.0-20210930031921-04548b0d99d4 // indirect github.com/cncf/xds/go v0.0.0-20211130200136-a8f946100490 // indirect github.com/coreos/go-semver v0.3.0 // indirect github.com/coreos/go-systemd/v22 v22.3.2 // indirect github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect github.com/envoyproxy/go-control-plane v0.10.2-0.20220325020618-49ff273808a1 // indirect github.com/envoyproxy/protoc-gen-validate v0.6.2 // indirect github.com/fsnotify/fsnotify v1.5.4 // indirect github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect github.com/google/go-cmp v0.5.8 // indirect github.com/google/uuid v1.1.2 // indirect github.com/googleapis/enterprise-certificate-proxy v0.1.0 // indirect github.com/googleapis/gax-go/v2 v2.4.0 // indirect github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1 // indirect github.com/hashicorp/hcl v1.0.0 // indirect github.com/jonboulle/clockwork v0.2.2 // indirect github.com/jtolds/gls v4.20.0+incompatible // indirect github.com/lestrrat-go/strftime v1.0.5 // indirect github.com/magiconair/properties v1.8.6 // indirect github.com/mattn/go-runewidth v0.0.9 // indirect github.com/matttproud/golang_protobuf_extensions v1.0.1 // indirect github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/reflect2 v1.0.2 // indirect github.com/oklog/run v1.1.0 // indirect github.com/pelletier/go-toml v1.9.5 // indirect github.com/pelletier/go-toml/v2 v2.0.1 // indirect github.com/prometheus/client_model v0.2.0 // indirect github.com/prometheus/common v0.32.1 // indirect github.com/prometheus/procfs v0.7.3 // indirect github.com/sirupsen/logrus v1.7.0 // indirect github.com/smartystreets/assertions v1.2.0 // indirect github.com/spf13/afero v1.8.2 // indirect github.com/spf13/jwalterweatherman v1.1.0 // indirect github.com/spf13/pflag v1.0.5 // indirect github.com/stretchr/objx v0.3.0 // indirect github.com/subosito/gotenv v1.3.0 // indirect github.com/tidwall/gjson v1.2.1 // indirect github.com/tidwall/match v1.0.1 // indirect github.com/tidwall/pretty v0.0.0-20190325153808-1166b9ac2b65 // indirect github.com/uber/jaeger-lib v2.4.1+incompatible // indirect go.etcd.io/etcd/client/pkg/v3 v3.5.4 // indirect golang.org/x/oauth2 v0.0.0-20220608161450-d0670ef3b1eb // indirect golang.org/x/sys v0.0.0-20220615213510-4f61da869c0c // indirect golang.org/x/text v0.3.7 // indirect golang.org/x/xerrors v0.0.0-20220609144429-65e65417b02f // indirect google.golang.org/api v0.85.0 // indirect google.golang.org/appengine v1.6.7 // indirect google.golang.org/genproto v0.0.0-20220617124728-180714bec0ad // indirect google.golang.org/protobuf v1.28.0 // indirect gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect gopkg.in/ini.v1 v1.66.4 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.0 // indirect stathat.com/c/consistent v1.0.0 // indirect )

oligot commented 2 years ago

When running

go mod vendor

with you go.mod file, I've this error

go: warning: "all" matched no packages

And no vendor directory is created.

Do you know how to solve this issue ?

bighunter513 commented 2 years ago

When running

go mod vendor

with you go.mod file, I've this error

go: warning: "all" matched no packages

And no vendor directory is created.

Do you know how to solve this issue ?

I didn't encounter this error, I run go mod vendor is ok.

c0olix commented 2 years ago

Also have the same error, when vendor dir is present and version is >v0.8.0

oligot commented 2 years ago

I was able to reproduce this bug on my side. This is now fixed in the brand new version v0.9.1.