aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVitaly Bogdanov <vsbogd@gmail.com>2019-05-28 02:28:17 +0800
committerGuillaume Ballet <gballet@gmail.com>2019-05-28 02:28:17 +0800
commit5429dc75bd15e5436221cc08891b6ef3c9d2378e (patch)
tree816566f1a5fd21d525e056d05733216d319fd1db
parentc4de228e18869c788ba2d1764126121e4bf900ac (diff)
downloadgo-tangerine-5429dc75bd15e5436221cc08891b6ef3c9d2378e.tar
go-tangerine-5429dc75bd15e5436221cc08891b6ef3c9d2378e.tar.gz
go-tangerine-5429dc75bd15e5436221cc08891b6ef3c9d2378e.tar.bz2
go-tangerine-5429dc75bd15e5436221cc08891b6ef3c9d2378e.tar.lz
go-tangerine-5429dc75bd15e5436221cc08891b6ef3c9d2378e.tar.xz
go-tangerine-5429dc75bd15e5436221cc08891b6ef3c9d2378e.tar.zst
go-tangerine-5429dc75bd15e5436221cc08891b6ef3c9d2378e.zip
cmd/abigen: allow using `abigen --pkg` flag with standard input (#19207)
-rw-r--r--cmd/abigen/main.go11
1 files changed, 3 insertions, 8 deletions
diff --git a/cmd/abigen/main.go b/cmd/abigen/main.go
index b6ec04ce1..461c29468 100644
--- a/cmd/abigen/main.go
+++ b/cmd/abigen/main.go
@@ -81,7 +81,7 @@ func main() {
bins []string
types []string
)
- if *solFlag != "" || *vyFlag != "" || (*abiFlag == "-" && *pkgFlag == "") {
+ if *solFlag != "" || *vyFlag != "" || *abiFlag == "-" {
// Generate the list of types to exclude from binding
exclude := make(map[string]bool)
for _, kind := range strings.Split(*excFlag, ",") {
@@ -129,13 +129,8 @@ func main() {
}
} else {
// Otherwise load up the ABI, optional bytecode and type name from the parameters
- var abi []byte
- var err error
- if *abiFlag == "-" {
- abi, err = ioutil.ReadAll(os.Stdin)
- } else {
- abi, err = ioutil.ReadFile(*abiFlag)
- }
+ abi, err := ioutil.ReadFile(*abiFlag)
+
if err != nil {
fmt.Printf("Failed to read input ABI: %v\n", err)
os.Exit(-1)