aboutsummaryrefslogtreecommitdiffstats
path: root/accounts/abi/bind/bind.go
diff options
context:
space:
mode:
authorPéter Szilágyi <peterke@gmail.com>2016-11-11 16:27:30 +0800
committerPéter Szilágyi <peterke@gmail.com>2016-11-15 00:00:14 +0800
commit5513c49c54f42ce6a9683b4fad9193b361b47f8c (patch)
treeb7cf78b5e788114d88aa6ae48db8bb32373a180d /accounts/abi/bind/bind.go
parentb61f48e5aad9cf897f5655a0db002a3349109c67 (diff)
downloaddexon-5513c49c54f42ce6a9683b4fad9193b361b47f8c.tar
dexon-5513c49c54f42ce6a9683b4fad9193b361b47f8c.tar.gz
dexon-5513c49c54f42ce6a9683b4fad9193b361b47f8c.tar.bz2
dexon-5513c49c54f42ce6a9683b4fad9193b361b47f8c.tar.lz
dexon-5513c49c54f42ce6a9683b4fad9193b361b47f8c.tar.xz
dexon-5513c49c54f42ce6a9683b4fad9193b361b47f8c.tar.zst
dexon-5513c49c54f42ce6a9683b4fad9193b361b47f8c.zip
accounts/abi/bind, mobile: review fixes and android tests
Diffstat (limited to 'accounts/abi/bind/bind.go')
-rw-r--r--accounts/abi/bind/bind.go14
1 files changed, 9 insertions, 5 deletions
diff --git a/accounts/abi/bind/bind.go b/accounts/abi/bind/bind.go
index 154c67b0e..84cf22e3c 100644
--- a/accounts/abi/bind/bind.go
+++ b/accounts/abi/bind/bind.go
@@ -120,12 +120,16 @@ func Bind(types []string, abis []string, bytecodes []string, pkg string, lang La
if err := tmpl.Execute(buffer, data); err != nil {
return "", err
}
- // Pass the code through goimports to clean it up and double check
- code, err := imports.Process("", buffer.Bytes(), nil)
- if err != nil {
- return "", fmt.Errorf("%v\n%s", err, buffer)
+ // For Go bindings pass the code through goimports to clean it up and double check
+ if lang == LangGo {
+ code, err := imports.Process("", buffer.Bytes(), nil)
+ if err != nil {
+ return "", fmt.Errorf("%v\n%s", err, buffer)
+ }
+ return string(code), nil
}
- return string(code), nil
+ // For all others just return as is for now
+ return string(buffer.Bytes()), nil
}
// bindType is a set of type binders that convert Solidity types to some supported