-
Notifications
You must be signed in to change notification settings - Fork 5.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error: go get github.com/argoproj/argo-cd #7562
Comments
ProblemThis is due to golang checksum mismatch Important thing: Close your IDE and repeat the steps: Solution
Remove go.sum then re-generate it |
** it's still the same mistake** (⎈ |281134809827408378-c31ce6092609a48f5b4fab6f48dacc931:zhengyansheng)➜ pkg git:(dev) ✗ cd
(⎈ |281134809827408378-c31ce6092609a48f5b4fab6f48dacc931:zhengyansheng)➜ ~ go clean -modcache
(⎈ |281134809827408378-c31ce6092609a48f5b4fab6f48dacc931:zhengyansheng)➜ ~ cd -
~/go/coding/pkg
(⎈ |281134809827408378-c31ce6092609a48f5b4fab6f48dacc931:zhengyansheng)➜ pkg git:(dev) ✗ rm go.sum
rm: go.sum: No such file or directory
(⎈ |281134809827408378-c31ce6092609a48f5b4fab6f48dacc931:zhengyansheng)➜ pkg git:(dev) ✗ go mod tidy
go: downloading github.com/ghodss/yaml v1.0.0
go: downloading github.com/xanzy/go-gitlab v0.51.1
go: downloading github.com/stretchr/testify v1.7.0
go: downloading k8s.io/api v0.22.2
go: downloading k8s.io/apimachinery v0.22.2
go: downloading sigs.k8s.io/kustomize/api v0.10.0
go: downloading github.com/davecgh/go-spew v1.1.1
go: downloading github.com/pmezard/go-difflib v1.0.0
go: downloading gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b
go: downloading gopkg.in/yaml.v2 v2.4.0
go: downloading github.com/google/go-querystring v1.0.0
go: downloading github.com/hashicorp/go-cleanhttp v0.5.1
go: downloading github.com/hashicorp/go-retryablehttp v0.6.8
go: downloading golang.org/x/oauth2 v0.0.0-20181106182150-f42d05182288
go: downloading golang.org/x/time v0.0.0-20191024005414-555d28b269f0
go: downloading github.com/gogo/protobuf v1.3.2
go: downloading github.com/pkg/errors v0.9.1
go: downloading sigs.k8s.io/kustomize/kyaml v0.12.0
go: downloading sigs.k8s.io/yaml v1.2.0
go: downloading gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f
go: downloading github.com/hashicorp/go-hclog v0.9.2
go: downloading github.com/google/gofuzz v1.1.0
go: downloading k8s.io/klog/v2 v2.9.0
go: downloading gopkg.in/inf.v0 v0.9.1
go: downloading sigs.k8s.io/structured-merge-diff/v4 v4.1.2
go: downloading golang.org/x/net v0.0.0-20210520170846-37e1c6afe023
go: downloading google.golang.org/appengine v1.4.0
go: downloading github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e
go: downloading github.com/google/go-cmp v0.5.5
go: downloading github.com/json-iterator/go v1.1.11
go: downloading github.com/modern-go/reflect2 v1.0.1
go: downloading k8s.io/kube-openapi v0.0.0-20210421082810-95288971da7e
go: downloading github.com/go-logr/logr v0.4.0
go: downloading github.com/spf13/pflag v1.0.5
go: downloading github.com/kr/text v0.2.0
go: downloading github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd
go: downloading golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1
go: downloading github.com/go-errors/errors v1.0.1
go: downloading github.com/go-openapi/jsonreference v0.19.3
go: downloading github.com/go-openapi/swag v0.19.5
go: downloading github.com/golang/protobuf v1.5.2
go: downloading github.com/PuerkitoBio/purell v1.1.1
go: downloading github.com/go-openapi/jsonpointer v0.19.3
go: downloading github.com/mailru/easyjson v0.7.0
go: downloading github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578
go: downloading golang.org/x/text v0.3.6
go: downloading google.golang.org/protobuf v1.26.0
go: finding module for package github.com/argoproj/argo-cd/pkg/apis/application/v1alpha1/types
go: downloading github.com/argoproj/argo-cd v1.8.7
git.bg.huohua.cn/cloud-native/pkg/kube imports
github.com/argoproj/argo-cd/pkg/apis/application/v1alpha1/types: github.com/argoproj/argo-cd@v1.8.7: verifying module: checksum mismatch
downloaded: h1:CkIu8p/gcTY/fOZWM2tHuSCIAV2HggXjJftrT1IIT3k=
gosum.io: h1:w72dPaPuwbWgtYCdVbvXhJu0vc86ud5cQNJs7BM7TEs=
SECURITY ERROR
This download does NOT match the one reported by the checksum server.
The bits may have been replaced on the origin server, or an attacker may
have intercepted the download attempt.
For more information, see 'go help module-auth'.
(⎈ |281134809827408378-c31ce6092609a48f5b4fab6f48dacc931:zhengyansheng)➜ pkg git:(dev) ✗ kube package package kube
import (
"github.com/argoproj/argo-cd/pkg/apis/application/v1alpha1/types"
)
//
type Application struct {
}
// Render return deployment struct
func (a *Application) Render() *types.Application {
return nil
} |
if i use argocd 2.x, an error is reported as flows # go mod tidy
go: github.com/argoproj/argo-cd/v2@v2.1.4 requires
github.com/argoproj/gitops-engine@v0.4.1 requires
k8s.io/kubernetes@v1.21.0 requires
k8s.io/api@v0.0.0: reading k8s.io/api/go.mod at revision v0.0.0: unknown revision v0.0.0 |
For importing argocd 2.x, see this comment, it fixes the issue temporally: #4055 (comment) |
Hello, there is still a mistake to operate according to your method. My code package main
import (
"github.com/argoproj/argo-cd/pkg/apis/application/v1alpha1/types"
)
type Application struct {
}
// Render return deployment struct
func (a *Application) Render() *types.Application {
return nil
}
func main() {
} go.mod
execute my code # go mod tidy
go: finding module for package github.com/argoproj/argo-cd/pkg/apis/application/v1alpha1/types
go: downloading github.com/argoproj/argo-cd v1.8.7
3x imports
github.com/argoproj/argo-cd/pkg/apis/application/v1alpha1/types: module github.com/argoproj/argo-cd@latest found (v1.8.7), but does not contain package github.com/argoproj/argo-cd/pkg/apis/application/v1alpha1/types |
Did you update your import? |
After importing and modifying, it is still wrong # go mod tidy
go: downloading github.com/argoproj/argo-cd/v2 v2.0.5
go: finding module for package github.com/argoproj/argo-cd/v2/pkg/apis/application/v1alpha1/types
go: downloading github.com/argoproj/argo-cd v1.8.7
go: downloading github.com/argoproj/argo-cd/v2 v2.1.5
a3x imports
github.com/argoproj/argo-cd/v2/pkg/apis/application/v1alpha1/types: module github.com/argoproj/argo-cd/v2@latest found (v2.1.5), but does not contain package github.com/argoproj/argo-cd/v2/pkg/apis/application/v1alpha1/types This is my stepmy code package main
import (
"github.com/argoproj/argo-cd/v2/pkg/apis/application/v1alpha1/types" // version: v2
)
type Application struct {
}
// Render return deployment struct
func (a *Application) Render() *types.Application {
return nil
}
func main() {
} go.mod
Execute # go clean -modcache
# go mod tidy
go mod tidy
go: downloading github.com/argoproj/argo-cd/v2 v2.0.5
go: finding module for package github.com/argoproj/argo-cd/v2/pkg/apis/application/v1alpha1/types
go: downloading github.com/argoproj/argo-cd v1.8.7 // ***** incomprehension: Why does it download this version ****
go: downloading github.com/argoproj/argo-cd/v2 v2.1.5
a3x imports
github.com/argoproj/argo-cd/v2/pkg/apis/application/v1alpha1/types: module github.com/argoproj/argo-cd/v2@latest found (v2.1.5), but does not contain package github.com/argoproj/argo-cd/v2/pkg/apis/application/v1alpha1/types |
No need for types at the end of the import.
Go Mod from: #4055 (comment) |
# go env | grep GOPROXY
GOPROXY="https://goproxy.cn,direct"
# go env | grep GOSUM
GOSUMDB="on"
# git clone git@github.com:zhengyansheng/argocd-pkg.git
# cd argocd-pkg/
# go run main.go
hello argocd!
# git clone git@github.com:zhengyansheng/argocd-pkg.git
# cd argocd-pkg/
# go run main.go
hello argocd!
# rm -f go.sum
# go run main.go
go: github.com/argoproj/argo-cd/v2@v2.1.5: missing go.sum entry; to add it:
go mod download github.com/argoproj/argo-cd/v2
# go mod tidy
go: github.com/argoproj/argo-cd/v2@v2.1.5: verifying go.mod: invalid GOSUMDB: malformed verifier id
|
Describe the bug
Version
# go version go version go1.16.3 darwin/amd64
Logs
same type of problem
The text was updated successfully, but these errors were encountered: