Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
cmd/go: synchronize and remove packages duplicated in x/mod #34801
There are several module-related packages that appear in both
When Russ copied these packages to x/mod, he added documentation and renamed some definitions. We should not undo that. At the same time, we should be careful to copy any changes and fixes to these packages from cmd/go to x/mod in a way that doesn't break compatibility.
This change integrates changes made to x/mod packages into our internal copies of those packages. This is the first step of a bidirectional synchronization. A follow-up change will copy changes made to the internal packages after x/mod was forked. After that, we can vendor x/mod, update imports, and delete the internal copies. The following packages are affected: * internal/module * internal/semver (no change) * internal/sumweb (renamed to internal/sumdb) * internal/dirhash * internal/note * internal/tlog Several integrated changes affect other packages: * cmd/go/internal/module.MatchPathMajor now wraps a new function, CheckPathMajor, which returns error. MatchPathMajor returns bool. This will avoid an incompatible change in the next step. * module.EncodePath renamed to EscapePath, EncodeVersion to EscapeVersion, DecodePath to UnescapePath, DecodeVersion to UnescapeVersion. * cmd/go/internal/sumweb moved to cmd/go/internal/sumdb and package renamed to sumdb. * sumdb.Client renamed to ClientOps, Conn to Client, Server to ServerOps, Paths to ServerPaths. * sumdb/encode.go and encode_test.go are not present in x/mod since they are redundant with functionality in module. Both files are deleted. * sumdb.TestServer doesn't implement sumdb.ServerOps after changes were were made to golang.org/x/mod/sumdb.ServerOps during the fork. Local changes made so tests will pass. These will be copied to x/mod in the next step. Updates #34801 Change-Id: I7e820f10ae0cdbec238e59d039e978fd1cdc7201 Reviewed-on: https://go-review.googlesource.com/c/go/+/200138 Run-TryBot: Jay Conrod <firstname.lastname@example.org> TryBot-Result: Gobot Gobot <email@example.com> Reviewed-by: Bryan C. Mills <firstname.lastname@example.org>