gitignore icon indicating copy to clipboard operation
gitignore copied to clipboard

Ignore go.work.sum

Open katexochen opened this issue 2 years ago • 8 comments

Reasons for making this change:

As the go.work file is excluded, the go.work.sum file, which is generated based on the go.work file, should be excluded, too. Also mentioned in https://github.com/github/gitignore/commit/fbc053fe49d7f3b4a882ddf9651fc60f8954db21#commitcomment-73352144

Links to documentation supporting these rule changes: Currently there isn't much documentation regarding go.work.sum (see https://github.com/golang/go/issues/51941), the only thing I can refer to is the proposal, which suggests to not check in the go.work file.

katexochen avatar May 31 '22 16:05 katexochen

To further support these changes, here are some examples for popular repos ignoring go.work.sum: https://github.com/hashicorp/nomad/pull/13193 https://github.com/gravitational/teleport/pull/12098 https://github.com/sourcegraph/sourcegraph/pull/36049

katexochen avatar Jun 01 '22 07:06 katexochen

Why not **go.sum? The sum file is used to check locally, I think.

StLeoX avatar Jul 26 '22 07:07 StLeoX

Why not **go.sum? The sum file is used to check locally, I think.

Typically your module's go.sum file should be committed along with your go.mod file.

katexochen avatar Jul 26 '22 08:07 katexochen

@avelino, @Nirusu will this get merged?

rubenpoppe avatar Mar 31 '23 14:03 rubenpoppe

I'm in favor of this change - if go.work is ignored, then go.work.sum should also be ignored. Note that there's not actually a recommendation or even consensus on whether these files should be ignored. My read on the situation is that for cases like a monorepo, you probably do want to commit these files but in many other situations, you do not. See the discussion at https://github.com/golang/go/issues/53502.

smoyer64 avatar May 17 '23 13:05 smoyer64

@bdougie, could you please take a look at this PR since you already merged #3884? The file mentioned here is a checksum file that is autogenerated, and present iif go.work file is present in the local repository. Since go.work is ignored, we should ignore go.work.sum files as well.

goto1134 avatar Aug 21 '23 20:08 goto1134

Hey there, I noticed that the PR is already approved. is there an estimated timeframe for when it might be merged? Just curious and looking forward to it

Omarabdul3ziz avatar Jan 10 '24 19:01 Omarabdul3ziz

I think those gray check marks indicate that the approvals are by developers who are not CODEOWNERS. I don't even see a merge button!

smoyer64 avatar Jan 11 '24 00:01 smoyer64