Skip to content

cmd/go: mod tidy should ignore missing standard library packages #44557

Closed
@rsc

Description

@rsc

We know the standard library will not have dependencies on other modules, so in this example it shouldn't matter that Go 1.15 cannot find io/fs:

% cd /Users/rsc/src/golang.org/x/tools
% go mod tidy
% go1.16 mod tidy
% go1.15 mod tidy
golang.org/x/tools/cmd/present imports
	embed: package embed is not in GOROOT (/Users/rsc/sdk/go1.15/src/embed)
golang.org/x/tools/cmd/present imports
	io/fs: package io/fs is not in GOROOT (/Users/rsc/sdk/go1.15/src/io/fs)
golang.org/x/tools/go/analysis/passes/buildtag imports
	go/build/constraint: package go/build/constraint is not in GOROOT (/Users/rsc/sdk/go1.15/src/go/build/constraint)
% 

That is, go1.15 mod tidy should work.

And we should think about backporting this change.

/cc @bcmills @jayconrod @matloob

Metadata

Metadata

Assignees

No one assigned

    Labels

    FrozenDueToAgeGoCommandcmd/goNeedsFixThe path to resolution is known, but the work has not been done.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions