alibaba / IOC-golang

一款服务于 Go 开发者的依赖注入框架,方便搭建任何 Go 应用。 A Golang depenedency injection framework, helps developers to build any go application.

Home Page:https://ioc-golang.github.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Upgrade dependency "github.com/nacos-group/nacos-sdk-go"

Ben131-Go opened this issue · comments

Background

Repo github.com/alibaba/IOC-golang depends on github.com/nacos-group/nacos-sdk-go/v2@v2.0.2.

https://github.com/alibaba/IOC-golang/blob/master/go.mod#L17

However, comparing version v2.0.2 of github.com/nacos-group/nacos-sdk-go from proxy.golang.org and github, there are inconsistencies.

commit time of the copy on github.com

"committer": {
      "name": "realJackSun",
      "email": "sjtusl@163.com",
      "date": "2022-04-12T09:29:19Z"
    }

commit time of the copy on proxy.golang.org

{"Version":"v2.0.2","Time":"2022-04-10T07:45:39Z"}

So the checksum from the code in github does not match the checksum saved in sum.golang.org. The v2.0.2 tag of github.com/nacos-group/nacos-sdk-go might have been retagged after a minor edition on github. I guess you use proxy.golang.org to get dependencies, but that also shows that your project is depending on the copy of github.com/nacos-group/nacos-sdk-go@v2.0.2 before its edition. Depending upon such inconsistent tag version may also result in some unexpected errors as well as build errors due to different proxy settings.

For example, when someone who does not use proxy.golang.org, say GOPROXY=direct, attempts to get github.com/nacos-group/nacos-sdk-go/v2@v2.0.2, the following error occurs.

go: downloading github.com/nacos-group/nacos-sdk-go/v2 v2.0.2
go: github.com/nacos-group/nacos-sdk-go/v2@v2.0.2: verifying module: checksum mismatch
        downloaded: h1:FHd9IZk95mNLK2OfVSWKGQOeMaR5QSfDUlgwmuC9mqA=
        sum.golang.org: h1:ajCkBB1xcANKL/7XwRiWiUv9ufqoGdDDhPZzDuerz6A=

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'.

So, this is a reminder in the hope that you can get rid of this problematic version of project github.com/nacos-group/nacos-sdk-go.

Solution

1. Bump the version of dependency github.com/nacos-group/nacos-sdk-go

I would recommend bumping the version of github.com/nacos-group/nacos-sdk-go to a new release to ensure dependency copy in proxy.golang.org and github in sync.

References