rules_go icon indicating copy to clipboard operation
rules_go copied to clipboard

Automatically run `bazel mod tidy` in `@rules_go//go`

Open fmeum opened this issue 10 months ago • 2 comments

What type of PR is this?

Feature

What does this PR do? Why is it needed?

bazel mod tidy is run if supported and if relevant files change due to the command.

Which issues(s) does this PR fix?

Fixes #3900 Fixes https://github.com/bazelbuild/bazel-gazelle/issues/1749

Other notes for review

fmeum avatar Apr 24 '24 10:04 fmeum

Just checking, will this also work for users of go.work workspaces?

stefanpenner avatar May 07 '24 18:05 stefanpenner

Just checking, will this also work for users of go.work workspaces?

This requires adding the relevant files to https://github.com/bazelbuild/bazel-gazelle/blob/7c84c339075a992ea1a6f720899d91c0e047efe2/internal/bzlmod/go_deps.bzl#L657. Maybe that already happens with the fake go.mod files we create for a workspace?

fmeum avatar May 07 '24 18:05 fmeum