• Jay Conrod's avatar
    cmd/go: add -modfile flag that sets go.mod file to read/write · c357b363
    Jay Conrod authored
    This change adds the -modfile flag to module aware build commands and
    to 'go mod' subcommands. -modfile may be set to a path to an alternate
    go.mod file to be read and written. A real go.mod file must still
    exist and is used to set the module root directory. However, it is not
    opened.
    
    When -modfile is set, the effective location of the go.sum file is
    also changed to the -modfile with the ".mod" suffix trimmed (if
    present) and ".sum" added.
    
    Updates #34506
    
    Change-Id: I2d1e044e18af55505a4f24bbff09b73bb9c908b4
    Reviewed-on: https://go-review.googlesource.com/c/go/+/202564
    Run-TryBot: Jay Conrod <jayconrod@google.com>
    TryBot-Result: Gobot Gobot <gobot@golang.org>
    Reviewed-by: default avatarBryan C. Mills <bcmills@google.com>
    c357b363
go1.14.html 7.72 KB