Skip to content

Commit 5ba9225

Browse files
nkbaifjl
authored andcommitted
accounts/abi/bind: pass non-empty directory when calling goimports (#15070)
1 parent fc87bc5 commit 5ba9225

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

accounts/abi/bind/bind.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ func Bind(types []string, abis []string, bytecodes []string, pkg string, lang La
122122
}
123123
// For Go bindings pass the code through goimports to clean it up and double check
124124
if lang == LangGo {
125-
code, err := imports.Process("", buffer.Bytes(), nil)
125+
code, err := imports.Process(".", buffer.Bytes(), nil)
126126
if err != nil {
127127
return "", fmt.Errorf("%v\n%s", err, buffer)
128128
}

accounts/abi/bind/bind_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -459,7 +459,7 @@ func TestBindings(t *testing.T) {
459459
}
460460
// Skip the test if the go-ethereum sources are symlinked (https://github.com/golang/go/issues/14845)
461461
linkTestCode := fmt.Sprintf("package linktest\nfunc CheckSymlinks(){\nfmt.Println(backends.NewSimulatedBackend(nil))\n}")
462-
linkTestDeps, err := imports.Process("", []byte(linkTestCode), nil)
462+
linkTestDeps, err := imports.Process(os.TempDir(), []byte(linkTestCode), nil)
463463
if err != nil {
464464
t.Fatalf("failed check for goimports symlink bug: %v", err)
465465
}

0 commit comments

Comments
 (0)