aboutsummaryrefslogtreecommitdiffstats
path: root/accounts/abi/bind/bind.go
diff options
context:
space:
mode:
authorJeremy Schlatter <jeremy.schlatter@gmail.com>2018-10-06 04:24:54 +0800
committerFelix Lange <fjl@users.noreply.github.com>2018-10-06 04:24:54 +0800
commit5ed3960b9b2f699233452fb8445c5f9feb281f78 (patch)
treeeaabc155b73fc6cffc0566085abc17e00a36ed27 /accounts/abi/bind/bind.go
parent5b0c9c8ae5f23b760992b6160a59b261be0d09d7 (diff)
downloaddexon-5ed3960b9b2f699233452fb8445c5f9feb281f78.tar
dexon-5ed3960b9b2f699233452fb8445c5f9feb281f78.tar.gz
dexon-5ed3960b9b2f699233452fb8445c5f9feb281f78.tar.bz2
dexon-5ed3960b9b2f699233452fb8445c5f9feb281f78.tar.lz
dexon-5ed3960b9b2f699233452fb8445c5f9feb281f78.tar.xz
dexon-5ed3960b9b2f699233452fb8445c5f9feb281f78.tar.zst
dexon-5ed3960b9b2f699233452fb8445c5f9feb281f78.zip
accounts/abi/bind: stop using goimports in the binding generator (#17768)
Diffstat (limited to 'accounts/abi/bind/bind.go')
-rw-r--r--accounts/abi/bind/bind.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/accounts/abi/bind/bind.go b/accounts/abi/bind/bind.go
index 172bed8fa..4dca4b4ea 100644
--- a/accounts/abi/bind/bind.go
+++ b/accounts/abi/bind/bind.go
@@ -23,13 +23,13 @@ package bind
import (
"bytes"
"fmt"
+ "go/format"
"regexp"
"strings"
"text/template"
"unicode"
"github.com/ethereum/go-ethereum/accounts/abi"
- "golang.org/x/tools/imports"
)
// Lang is a target programming language selector to generate bindings for.
@@ -145,9 +145,9 @@ func Bind(types []string, abis []string, bytecodes []string, pkg string, lang La
if err := tmpl.Execute(buffer, data); err != nil {
return "", err
}
- // For Go bindings pass the code through goimports to clean it up and double check
+ // For Go bindings pass the code through gofmt to clean it up
if lang == LangGo {
- code, err := imports.Process(".", buffer.Bytes(), nil)
+ code, err := format.Source(buffer.Bytes())
if err != nil {
return "", fmt.Errorf("%v\n%s", err, buffer)
}