Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion internal/goroot/importcfg.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ func PkgfileMap() (map[string]string, error) {
}
sp := strings.SplitN(line, " ", 2)
if len(sp) != 2 {
err = fmt.Errorf("determining pkgfile map: invalid line in go list output: %q", line)
stdlibPkgfileErr = fmt.Errorf("determining pkgfile map: invalid line in go list output: %q", line)
return
}
importPath, export := sp[0], sp[1]
Expand Down
3 changes: 3 additions & 0 deletions internal/imports/sourcex_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,9 @@ func TestSource(t *testing.T) {
opts := imports.Options{}
// ApplyFixes needs a non-nil opts
got, err := imports.ApplyFixes(fixes, "tfile.go", []byte(fx), &opts, 0)
if err != nil {
t.Fatal(err)
}

fxwant := "package main\n\nimport \"bar.com/foo\"\n\nvar _ = foo.Foo\nvar _ = foo.Bar\n"
if diff := cmp.Diff(string(got), fxwant); diff != "" {
Expand Down