google / note-maps

A personal knowledge base, an experimental project under development.
Apache License 2.0
119 stars 19 forks source link

Upgrade dependency "github.com/textileio/go-threads" #26

Open Ben131-Go opened 1 year ago

Ben131-Go commented 1 year ago

Background

Repo github.com/google/note-maps depends on github.com/textileio/go-threads@v1.0.2.
https://github.com/google/note-maps/blob/main/go.mod#L15
However, comparing version v1.0.2 of github.com/textileio/go-threads from proxy.golang.org and github, there are inconsistencies.

commit time of the copy on github.com

"committer": {
"name": "GitHub",
"email": "noreply@github.com",
"date": "2020-12-01T22:14:02Z"
}

commit time of the copy on proxy.golang.org

{"Version":"v1.0.2","Time":"2020-12-01T16:30:47Z"}

So the checksum from the code in github does not match the checksum saved in sum.golang.org. The v1.0.2 tag of github.com/textileio/go-threads might have been retagged after a minor edition. Depending upon such inconsistent tag version may 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 to download dependencies attempts to get github.com/textileio/go-threads@v1.0.2, the following errors occur.


go: downloading github.com/textileio/go-threads v1.0.2
go: github.com/textileio/go-threads@v1.0.2: verifying module: checksum mismatch
downloaded: h1:hrANmqXMuWFEpASIeAYiDU4m6X2b6bxVeeA48XYjTT4=
sum.golang.org: h1:iYUA/E9gx9ALpYNYSCwKGhV3yOjxf6QtLliRitnsFSk=

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


It is unwise to depend on such tag releases.
## Solution
### 1. Bump the version of dependency `github.com/textileio/go-threads`
I would recommend bumping the version of `github.com/textileio/go-threads` to a new release to ensure dependency copy in proxy.golang.org and github in sync.

## References
+ <https://proxy.golang.org/>