My project references to many public APIs, and it looks like they conflict with each other and results compilation error.
Here is my go.mod
module github.com/apulis/job-scheduler
go 1.16
require (
github.com/GoogleCloudPlatform/spark-on-k8s-operator v0.0.0-20210804054248-85b549ebc4ae
github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751
github.com/apulis/sdk/go-utils v0.0.0
github.com/apulis/simple-gin-logger v0.0.0
github.com/gin-gonic/contrib v0.0.0-20201101042839-6a891bf89f19
github.com/gin-gonic/gin v1.7.1
github.com/google/uuid v1.1.1
github.com/kubeflow/kfserving v0.6.0
github.com/myesui/uuid v1.0.0 // indirect
github.com/sirupsen/logrus v1.8.1
github.com/spf13/viper v1.7.0
github.com/stretchr/testify v1.7.0
github.com/swaggo/gin-swagger v1.3.1
github.com/swaggo/swag v1.7.1
github.com/twinj/uuid v1.0.0
gopkg.in/natefinch/lumberjack.v2 v2.0.0
gopkg.in/stretchr/testify.v1 v1.2.2 // indirect
gorm.io/driver/mysql v1.1.2
gorm.io/driver/postgres v1.1.0
gorm.io/gorm v1.21.13
k8s.io/api v0.19.6
k8s.io/apimachinery v0.19.6
k8s.io/client-go v11.0.1-0.20190805182717-6502b5e7b1b5+incompatible
k8s.io/klog/v2 v2.2.0
)
replace (
k8s.io/api => k8s.io/api v0.19.6
k8s.io/apiextensions-apiserver => k8s.io/apiextensions-apiserver v0.19.6
k8s.io/apimachinery => k8s.io/apimachinery v0.19.6
k8s.io/apiserver => k8s.io/apiserver v0.19.6
k8s.io/cli-runtime => k8s.io/cli-runtime v0.19.6
k8s.io/client-go => k8s.io/client-go v0.19.6
k8s.io/cloud-provider => k8s.io/cloud-provider v0.19.6
k8s.io/cluster-bootstrap => k8s.io/cluster-bootstrap v0.19.6
k8s.io/code-generator => k8s.io/code-generator v0.19.6
k8s.io/component-base => k8s.io/component-base v0.19.6
k8s.io/cri-api => k8s.io/cri-api v0.19.6
k8s.io/csi-translation-lib => k8s.io/csi-translation-lib v0.19.6
k8s.io/kube-aggregator => k8s.io/kube-aggregator v0.19.6
k8s.io/kube-controller-manager => k8s.io/kube-controller-manager v0.19.6
k8s.io/kube-proxy => k8s.io/kube-proxy v0.19.6
k8s.io/kube-scheduler => k8s.io/kube-scheduler v0.19.6
k8s.io/kubectl => k8s.io/kubectl v0.19.6
k8s.io/kubelet => k8s.io/kubelet v0.19.6
k8s.io/kubernetes => k8s.io/kubernetes v1.19.6
k8s.io/legacy-cloud-providers => k8s.io/legacy-cloud-providers v0.19.6
k8s.io/metrics => k8s.io/metrics v0.19.6
k8s.io/node-api => k8s.io/node-api v0.19.6
k8s.io/sample-apiserver => k8s.io/sample-apiserver v0.19.6
k8s.io/sample-cli-plugin => k8s.io/sample-cli-plugin v0.19.6
k8s.io/sample-controller => k8s.io/sample-controller v0.19.6
)
Below are the outputs:
git submodule init
git submodule update
go build -buildmode=pie -o bin/scheduler cmd/main.go
# sigs.k8s.io/kustomize/pkg/transformers/config
/root/go/pkg/mod/sigs.k8s.io/kustomize#v2.0.3+incompatible/
pkg/transformers/config/factorycrd.go:71:47:
cannot use api.Schema.SchemaProps.Properties (type
spec.SchemaProperties) as type myProperties in argument to
looksLikeAk8sType
The project compiles successfully until I added the kubectl/pkg/descriptor. I want to use those apis from kubectl.
To my surprise below code snippet works fine!!
package main
import (
desc "k8s.io/kubectl/pkg/describe"
"fmt"
)
func main() {
config := &desc.DescriberSettings{}
fmt.Println(config)
return
}
How to solve this issue?
If the subproject with the obsolete dependency is yours you can update the dependency version of the project and it will work after.
If the project is not yours then you can fork the project, update it's dependencies and from your top level project import your fork.
Your question is general and not Kubernetes specific yet you could ask around the maintainers why a minor version of their package contains breaking changes.
The culprit is that until relatively recent Kubernetes versions (1.21), kubectl integrated a very old version of kustomize (2.0.3). In your case, you're using kubernetes components of 0.19 which are only one year old, and kustomize 2.0.3 which is three years old. Kubernetes 1.21 finally updated kustomize that was built into kubectl after both projects managed to use compatible dependencies, and this kind of issues hopefully won't happen for the recent builds on recent components.
The particular issue that you've faced with is probably the one documented in kustomize. If it's the case, you can either update Kubernetes components to some version newer that 0.21 or downgrade k8s.io/kube-openapi. To confirm whether it's the issue, check out which version of k8s.io/kube-openapi is pulled into the dependency graph:
go list -m k8s.io/kube-openapi
If it's after v0.0.0-20210323165736, you can try using an older version:
go mod edit -replace k8s.io/kube-openapi=k8s.io/kubeopenapi#v0.0.0-20210323165736-1a6458611d18
I suppose that fix the problem, since most often people bump dependency version when it's not actually needed, but if doesn't help, you might try downgrade other dependent packages too. You can find a dependency path to mentioned package by:
go mod why -m k8s.io/kube-openapi
Related
I'm trying to deploy a simple API on Google Cloud using Go 1.19
> go version
go version go1.19.2 windows/amd64
I'm following this documentation as a template to deploy my app. But the deploy fails.
Updating service [default]...failed.
ERROR: (gcloud.app.deploy) Error Response: [9] Cloud build xxx status: FAILURE
go: github.com/go-redis/redis/v9#v9.0.0-rc.1 requires
github.com/onsi/ginkgo#v1.16.5: missing go.sum entry; to add it:
go mod download github.com/onsi/ginkgo
Cloud build log:
Running "go build -o /layers/google.go.build/bin/main . (GOCACHE=/layers/google.go.build/gocache)"
go: github.com/go-redis/redis/v9#v9.0.0-rc.1 requires
github.com/onsi/ginkgo#v1.16.5: missing go.sum entry; to add it:
go mod download github.com/onsi/ginkgo
Done "go build -o /layers/google.go.build/bin/main . (GOCACHE=/lay..." (7.516802ms)
Failure: (ID: 721b15b4) go: github.com/go-redis/redis/v9#v9.0.0-rc.1 requires
github.com/onsi/ginkgo#v1.16.5: missing go.sum entry; to add it:
go mod download github.com/onsi/ginkgo
--------------------------------------------------------------------------------
Running "mv -f /builder/outputs/output-5577006791947779410 /builder/outputs/output"
Done "mv -f /builder/outputs/output-5577006791947779410 /builder/o..." (3.938721ms)
ERROR: failed to build: exit status 1
Running the suggested go mod download github.com/onsi/ginkgo does not solve anything.
Also tried go mod tidy as suggested in another posts but same results. Also tried with vendor folder, but nothing again.
This is my app.yaml
runtime: go116
go.mod
module notams/anac
go 1.19
require (
github.com/go-redis/redis/v9 v9.0.0-rc.1
github.com/gorilla/mux v1.8.0
github.com/joho/godotenv v1.4.0
golang.org/x/exp v0.0.0-20221019170559-20944726eadf
)
require (
github.com/cespare/xxhash/v2 v2.1.2 // indirect
github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect
)
go.sum
github.com/cespare/xxhash/v2 v2.1.2 h1:YRXhKfTDauu4ajMg1TPgFO5jnlC2HCbmLXMcTG5cbYE=
github.com/cespare/xxhash/v2 v2.1.2/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f h1:lO4WD4F/rVNCu3HqELle0jiPLLBs70cWOduZpkS1E78=
github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f/go.mod h1:cuUVRXasLTGF7a8hSLbxyZXjz+1KgoB3wDUb6vlszIc=
github.com/fsnotify/fsnotify v1.4.9 h1:hsms1Qyu0jgnwNXIxa+/V/PDsU6CfLf6CNO8H7IWoS4=
github.com/go-redis/redis/v9 v9.0.0-rc.1 h1:/+bS+yeUnanqAbuD3QwlejzQZ+4eqgfUtFTG4b+QnXs=
github.com/go-redis/redis/v9 v9.0.0-rc.1/go.mod h1:8et+z03j0l8N+DvsVnclzjf3Dl/pFHgRk+2Ct1qw66A=
github.com/google/go-cmp v0.5.8 h1:e6P7q2lk1O+qJJb4BtCQXlK8vWEO8V1ZeuEdJNOqZyg=
github.com/gorilla/mux v1.8.0 h1:i40aqfkR1h2SlN9hojwV5ZA91wcXFOvkdNIeFDP5koI=
github.com/gorilla/mux v1.8.0/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So=
github.com/joho/godotenv v1.4.0 h1:3l4+N6zfMWnkbPEXKng2o2/MR5mSwTrBih4ZEkkz1lg=
github.com/joho/godotenv v1.4.0/go.mod h1:f4LDr5Voq0i2e/R5DDNOoa2zzDfwtkZa6DnEwAbqwq4=
github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE=
github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE=
github.com/onsi/gomega v1.21.1 h1:OB/euWYIExnPBohllTicTHmGTrMaqJ67nIu80j0/uEM=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/stretchr/testify v1.8.0 h1:pSgiaMZlXftHpm5L7V1+rVB+AZJydKsMxsQBIJw4PKk=
golang.org/x/exp v0.0.0-20221019170559-20944726eadf h1:nFVjjKDgNY37+ZSYCJmtYf7tOlfQswHqplG2eosjOMg=
golang.org/x/exp v0.0.0-20221019170559-20944726eadf/go.mod h1:cyybsKvd6eL0RnXn6p/Grxp8F5bW7iYuBgsNCOHpMYE=
golang.org/x/net v0.0.0-20220722155237-a158d28d115b h1:PxfKdU9lEEDYjdIzOtC4qFWgkU2rGHdKlKowJSMN9h0=
golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f h1:v4INt8xihDGvnrfjMDVXGxw9wrfxYyCjk0KbXjhR55s=
golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk=
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
EDIT 1: Already tried to change runtime: go and to runtime: go119 but those are not supported and return "invalid go runtime".
To anyone who might have this problem, I just deployed the app on Cloud Run instead of App Engine and everything runs smoothly. I was not able to deploy it on App Engine and i think that the only way to do so is adapting the code and modules to the latest runtime version available for GCP (currently Go 1.16).
We are using KFServing in our kubernetes cluster. The project provides InferenceService struct and clientset in the folder pkg/.
How to import these packages under pkg/client? My code is as below:
package main
import (
"fmt"
kfs
"github.com/kubeflow/kfserving/pkg/client/clientset/versioned"
)
func main() {
var clientset *kfs.Cientset
clientset = kfs.NewForConfig(nil)
fmt.Println(clientset)
}
Try go mod tidy i got (I need dev on specified version v0.5.1):
main imports
github.com/kubeflow/kfserving/pkg/client/clientset/versioned
imports
k8s.io/client-go/discovery imports
github.com/googleapis/gnostic/OpenAPIv2:
module github.com/googleapis/gnostic#latest found (v0.5.5),
but does not contain package
github.com/googleapis/gnostic/OpenAPIv2
main imports
github.com/kubeflow/kfserving/pkg/client/clientset/versioned
imports
...
Try compiling these code i got:
a lot of errors .....
After go get github.com/kubeflow/kfserving I got:
Then I changed the go.mod and reconfiged the kfseving version from v0.6.0 to v0.5.1 and then recompile these code, still got below error:
go build .
go: github.com/kubeflow/kfserving#v0.5.1: missing go.sum entry; to add it:
go mod download github.com/kubeflow/kfserving
contens of go.mod:
module main
go 1.16
require github.com/kubeflow/kfserving v0.5.1 // indirect
UPDATE
for kfserving v0.4.0 everything works well
Looking at the kfserving go.mod file at v0.5.1, I see a big block of replace directives. By design, replace directives “only apply in the main module's go.mod file and are ignored in other modules”, so it looks like kfserving has some technical debt here that they're passing on to you.
I started with an empty go.mod file and pasted in those replace directives. Then:
$ go get -d github.com/kubeflow/kfserving/pkg/client/clientset/versioned#v0.5.1
go get: added github.com/PuerkitoBio/purell v1.1.1
…
go get: added sigs.k8s.io/yaml v1.2.0
The .go source file needed a few fixes for typos and mismatched types. I fudged it to:
package main
import (
"fmt"
kfs "github.com/kubeflow/kfserving/pkg/client/clientset/versioned"
)
func main() {
var clientset *kfs.Clientset
clientset = kfs.NewForConfigOrDie(nil)
fmt.Println(clientset)
}
and then go build . succeeds:
$ go build -o /dev/null .
Now I'll run go mod tidy to clean up the go.mod and go.sum files:
$ go mod tidy
go: downloading github.com/stretchr/testify v1.5.1
…
go: downloading github.com/jmespath/go-jmespath v0.3.0
But wait! I've still got all of the technical debt from kfserving/go.mod — without any comments explaining the choice of versions! — and I'm passing that technical debt on to any downstream users. Let's see if I can improve the situation while I'm here.
Go 1.16 handles the exclude directive a lot better than previous Go versions did, so maybe I can use a couple of targeted exclude directives instead of the (rather large) replace hammer.
I'll start by committing the fixes so far. (If nothing else, I want to be able to git diff the requirements to see what has changed.)
$ git add *.go go.mod go.sum
$ git commit -m 'fixed kfserving build'
[main fd93b1d] fixed kfserving build
3 files changed, 1643 insertions(+), 2 deletions(-)
create mode 100644 go.sum
I notice that all of the replace directives apply to k8s.io paths, so I'll list the current versions of those paths to see what needs to be fixed:
$ go list -m k8s.io/...
k8s.io/api v0.19.2 => k8s.io/api v0.19.2
k8s.io/apiextensions-apiserver v0.19.2 => k8s.io/apiextensions-apiserver v0.19.2
k8s.io/apimachinery v0.19.2 => k8s.io/apimachinery v0.19.2
k8s.io/apiserver v0.19.2 => k8s.io/apiserver v0.19.2
k8s.io/client-go v11.0.1-0.20190805182717-6502b5e7b1b5+incompatible => k8s.io/client-go v0.19.2
k8s.io/cloud-provider v0.19.2 => k8s.io/cloud-provider v0.19.2
k8s.io/code-generator v0.19.2 => k8s.io/code-generator v0.19.2
k8s.io/component-base v0.19.2 => k8s.io/component-base v0.19.2
k8s.io/csi-translation-lib v0.19.2 => k8s.io/csi-translation-lib v0.19.2
k8s.io/gengo v0.0.0-20200428234225-8167cfdcfc14
k8s.io/klog v1.0.0 => k8s.io/klog v1.0.0
k8s.io/klog/v2 v2.2.0
k8s.io/kube-openapi v0.0.0-20200805222855-6aeccd4b50c6
k8s.io/legacy-cloud-providers v0.17.4 => k8s.io/legacy-cloud-providers v0.19.2
k8s.io/test-infra v0.0.0-20200803112140-d8aa4e063646 => k8s.io/test-infra v0.0.0-20200803112140-d8aa4e063646
k8s.io/utils v0.0.0-20200912215256-4140de9c8800 => k8s.io/utils v0.0.0-20200324210504-a9aa75ae1b89
Most of those look fine, but there are three mismatched versions:
k8s.io/client-go v11.0.1-0.20190805182717-6502b5e7b1b5+incompatible => k8s.io/client-go v0.19.2
…
k8s.io/legacy-cloud-providers v0.17.4 => k8s.io/legacy-cloud-providers v0.19.2
…
k8s.io/utils v0.0.0-20200912215256-4140de9c8800 => k8s.io/utils v0.0.0-20200324210504-a9aa75ae1b89
legacy-cloud-providers just needs an upgrade, so that should be easy enough to fix with go get — but it's not relevant to this package anyway so I can just let it float to whatever version it ends up at. I'll cut down the replace directives to just the two remaining modules and see how far I get:
replace (
k8s.io/client-go => k8s.io/client-go v0.19.2
k8s.io/utils => k8s.io/utils v0.0.0-20200324210504-a9aa75ae1b89
)
Now:
$ go mod tidy
$ go build -o /dev/null .
Ok, so the build is still good — I've made incremental progress, so I'll lock that in:
$ git add go.mod go.sum
$ git commit -m 'go.mod: remove irrelevant replacements'
[main cdbc1db] go.mod: remove irrelevant replacements
3 files changed, 456 insertions(+), 43 deletions(-)
rewrite go.mod (85%)
create mode 100755 m
Now let's try notching out the bad client-go versions with exclude directives:
$ go mod edit -exclude=k8s.io/client-go#v11.0.1-0.20190805182717-6502b5e7b1b5+incompatible
$ go list -m k8s.io/client-go
k8s.io/client-go v9.0.0+incompatible => k8s.io/client-go v0.19.2
$ go mod edit -exclude=k8s.io/client-go#v9.0.0+incompatible
$ go list -m k8s.io/client-go
k8s.io/client-go v0.19.2 => k8s.io/client-go v0.19.2
Now I'm at the client-go version I needed, so I can drop that replace directive:
$ go mod edit -dropreplace=k8s.io/client-go
$ go mod tidy
$ go build -o /dev/null .
And again lock it in:
$ git add go.mod go.sum
$ git commit -m 'go.mod: use exclude instead of replace to notch out unwanted client-go versions'
[main de69965] go.mod: use exclude instead of replace to notch out unwanted client-go versions
2 files changed, 21 insertions(+), 3 deletions(-)
Now let's see what's going on with this k8s.io/utils replacement. I suspect that it isn't really needed — the version will be upgraded a bit, but I'm betting it won't break the build. And, indeed, it seems to be fine:
$ go list -m k8s.io/utils
k8s.io/utils v0.0.0-20200912215256-4140de9c8800 => k8s.io/utils v0.0.0-20200324210504-a9aa75ae1b89
$ go mod edit -dropreplace=k8s.io/utils
$ go mod tidy
$ go build -o /dev/null .
$ go list -m k8s.io/utils
k8s.io/utils v0.0.0-20200912215256-4140de9c8800
So now I've successfully reduced that big nest of replace directives from kfserving to just a couple of exclude directives targeted retracted versions of k8s.io/client-go. Here's my whole go.mod file at the end of this process:
module example.com/m
go 1.16
exclude (
k8s.io/client-go v11.0.1-0.20190805182717-6502b5e7b1b5+incompatible
k8s.io/client-go v9.0.0+incompatible
)
require github.com/kubeflow/kfserving v0.5.1
This seems like a module cache issue cause that package appears to be there for v0.5.1. Do the following:
Clean the modcache go clean --modcache
Get the module the nice way via go get github.com/kubeflow/kfserving#v0.5.1
Run go mod tidy
Update
With the extra output I can see you you have an import error from a dependent module.
github.com/kubeflow/kfserving/pkg/client/clientset/versioned
imports
k8s.io/client-go/discovery imports
github.com/googleapis/gnostic/OpenAPIv2:
So version v0.5.1 imports k8s.io/client-go/discovery which imports github.com/googleapis/gnostic/OpenAPIv2 which no longer exists in the current release (but it is there is older releases). So it looks like you would need to fix the import version in client-go to avoid this issue.
I have a package that uses some local packages
module mycompany.com/clientname/server
go 1.14
require (
github.com/lib/pq v1.7.0
github.com/99designs/gqlgen v0.11.3
github.com/vektah/gqlparser/v2 v2.0.1
golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d
mycompany.com/clientname/models v0.0.0-00010101000000-000000000000
mycompany.com/common/utils v0.0.0-00010101000000-000000000000
)
replace mycompany.com/common/utils => ../../common/utils
replace mycompany.com/clientname/models => ../models
the mycompany.com domain doesn't serve the package, it is just a fictional path (and I use it in my gopath ~/go/src/mycompany.com/...)
the problem is that when I run go get -u all, I want the 'valid' packages to be updated (like the github.com/lib/pq or github.com/99designs/gqlgen), but to leave the local (fictional) packages as they are.
but go get -u all just prints out the new versions, then prints the errors on the local packages and then doesn't change go.mod.
go: google.golang.org/grpc upgrade => v1.30.0
go: go.opencensus.io upgrade => v0.22.4
go: github.com/mattn/go-runewidth upgrade => v0.0.9
go: github.com/gogs/chardet upgrade => v0.0.0-20191104214054-4b6791f73a28
go: golang.org/x/text upgrade => v0.3.3
go: github.com/mitchellh/mapstructure upgrade => v1.3.2
go get all: unrecognized import path "mycompany.com/clientname/models": reading https://mycompany.com/clientname/models?go-get=1: 404 Not Found
go get all: unrecognized import path "mycompany.com/common/utils": reading https://mycompany.com/common/utils?go-get=1: 404 Not Found
The error from go get -u was a bug in the go command, fixed in the upcoming Go 1.16 release. See https://golang.org/issue/32567 for detail.
(That said, ideally you should be hosting the modules in version control and using GOPRIVATE=mycompany.com instead of slotting things in locally via replace directives.)
I have a rest api I built in Go with gin that has been working for months now on my local machine running 1.12.1. I decided it was going to a docker deploy so I started building with 1.12.6 when I started see errors during module retrieval. I went back to my local machine, ran running 1.12.1 and ran go clean -modcache, now the error is there as well. I've tried regenerating multiple times even editing the go.sum file to different versions of gofight but I'm lost and run out of ideas.
The output w/error:
go: github.com/appleboy/gofight#v2.0.0+incompatible: go.mod has post-v2 module path "github.com/appleboy/gofight/v2" at revision v2.0.0
go: error loading module requirements
go.mod
module go-hybrid-alert
go 1.12
require (
cloud.google.com/go v0.37.0
firebase.google.com/go v3.6.0+incompatible
github.com/Luzifer/go-openssl v2.0.0+incompatible
github.com/PuerkitoBio/goquery v1.5.0
github.com/antchfx/htmlquery v1.0.0 // indirect
github.com/antchfx/xmlquery v1.0.0 // indirect
github.com/antchfx/xpath v0.0.0-20190129040759-c8489ed3251e // indirect
github.com/appleboy/gin-jwt v0.0.0-20190216100112-ca1084e5d5a2
github.com/gin-contrib/sse v0.0.0-20190301062529-5545eab6dad3 // indirect
github.com/gin-gonic/gin v1.3.0
github.com/go-redis/redis v6.15.2+incompatible
github.com/gobwas/glob v0.2.3 // indirect
github.com/gocolly/colly v1.2.0
github.com/kennygrant/sanitize v1.2.4 // indirect
github.com/kisielk/godepgraph v0.0.0-20181003180210-9a9a3d47fba3 // indirect
github.com/levigross/grequests v0.0.0-20190130132859-37c80f76a0da // indirect
github.com/mattn/go-isatty v0.0.7 // indirect
github.com/mitchellh/mapstructure v1.1.2
github.com/saintfish/chardet v0.0.0-20120816061221-3af4cd4741ca // indirect
github.com/temoto/robotstxt v0.0.0-20180810133444-97ee4a9ee6ea // indirect
github.com/ugorji/go/codec v0.0.0-20190316083543-95c34d148dff // indirect
golang.org/x/crypto v0.0.0-20190313024323-a1f597ede03a
golang.org/x/net v0.0.0-20190313220215-9f648a60d977
google.golang.org/api v0.2.0
gopkg.in/dgrijalva/jwt-go.v3 v3.2.0 // indirect
gopkg.in/go-playground/validator.v8 v8.18.2 // indirect
)
go.sum (the line for the module in question, posting the whole thing exceeds SO post length)
github.com/appleboy/gofight v2.0.0+incompatible/go.mod h1:H/tvof1oZHnZdlBd+AeODZGkk1C+D2na0NXr0iXuZHA=
I've also tried adjusting the go 1.12 statement in go.mod for the specific subversions I'm attempting to build with but that had no effect.
What does this error mean? How can I fix it?
A number of packages were outdated, the main fix was to run the new install command for gin-jwt, go get github.com/appleboy/gin-jwt/v2
Ultimately though I just nuked my go.mod and go.sum and did a fresh sync in Goland IDE. Everything is working on 1.12+
I've used "github.com/sirupsen/logrus" and I can't manage to remove it
I've tried
go mod tidy
go clean -modcache
This is the log:
go: github.com/Sirupsen/logrus#v1.4.0: parsing go.mod: unexpected module path "github.com/sirupsen/logrus"
I've even deleted the mod directory.
I've found the solution:
I've replace in go.mod
replace (
github.com/Sirupsen/logrus v1.3.0 => github.com/Sirupsen/logrus v1.0.6
github.com/Sirupsen/logrus v1.4.0 => github.com/sirupsen/logrus v1.0.6
github.com/Sirupsen/logrus v1.0.5 => github.com/sirupsen/logrus v1.0.5
)
github.com/Sirupsen/logrus/github.com/sirupsen/logrus is a breaking change; because an import path of github.com/Sirupsen/logrus now no longer works when in module mode (the irony). Hence I think the module release of github.com/Sirupsen/logrus/github.com/sirupsen/logrus should in fact have been a v2 release.
https://github.com/golang/go/issues/28489
https://github.com/golang/go/issues/26208