gotool

package
v0.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 6, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func TempModfileBuildFlags

func TempModfileBuildFlags(projectDir string) (flags []string, cleanup func(), err error)

TempModfileBuildFlags returns go command flags that allow module graph updates without mutating the project's go.mod/go.sum.

This is primarily to make packages.Load work reliably even when the project module isn't tidy (for example, a freshly scaffolded module that only requires a local replace).

It returns flags suitable for packages.Config.BuildFlags:

  • -mod=mod
  • -modfile=<temp file>

Call cleanup after packages.Load completes.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL