Skip to content

Commit 8819d3d

Browse files
committed
internal: fix unused errors reported by ineffassign
Updates #76704
1 parent c3feb70 commit 8819d3d

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

internal/goroot/importcfg.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ func PkgfileMap() (map[string]string, error) {
3838
}
3939
sp := strings.SplitN(line, " ", 2)
4040
if len(sp) != 2 {
41-
err = fmt.Errorf("determining pkgfile map: invalid line in go list output: %q", line)
41+
stdlibPkgfileErr = fmt.Errorf("determining pkgfile map: invalid line in go list output: %q", line)
4242
return
4343
}
4444
importPath, export := sp[0], sp[1]

internal/imports/sourcex_test.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,9 @@ func TestSource(t *testing.T) {
7878
opts := imports.Options{}
7979
// ApplyFixes needs a non-nil opts
8080
got, err := imports.ApplyFixes(fixes, "tfile.go", []byte(fx), &opts, 0)
81+
if err != nil {
82+
t.Fatal(err)
83+
}
8184

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

0 commit comments

Comments
 (0)