Skip to content

cmd/go: go work sync corrupts go.sum #50038

@hyangah

Description

@hyangah

What version of Go are you using (go version)?

 % gotip version
go version devel go1.18-cf1ec17360 Tue Dec 7 21:54:30 2021 +0000 darwin/amd64

What did you do?

Attempting to remove replace from golang.org/x/tools/gopls/go.mod,
set up the workspace like https://go-review.googlesource.com/c/tools/+/369959

% cat go.work 
go 1.18

use (
        ./.
        ./gopls
)

Then, ran gotip work sync.

What did you expect to see?

gopls/go.mod and gopls/go.sum are updated to reflect dependency changes (maybe?)

OTOH, I don't know what's the intended behavior.
The development was done using an uncommitted golang.org/x/tools module version.
If the code in golang.org/x/tools/gopls module depends on uncommitted changes in
golang.org/x/tools module, it's not possible to create a working go.mod /go.sum until
the change for golang.org/x/tools module is first committed & released.

It's likely I misunderstood the purpose of gotip work sync.

What did you see instead?

Changes like this : https://go-review.googlesource.com/c/tools/+/370194/1
See the go.sum file missing all entries.

@matloob

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions