cmd/abigen: simplify code a bit

This commit is contained in:
Felix Lange 2018-10-06 12:08:50 +02:00 committed by GitHub
parent 30e37cdca4
commit 6c1b4a503c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -115,16 +115,12 @@ func main() {
var err error var err error
if *abiFlag == "-" { if *abiFlag == "-" {
abi, err = ioutil.ReadAll(os.Stdin) abi, err = ioutil.ReadAll(os.Stdin)
if err != nil {
fmt.Printf("Failed to read input ABI from stdin: %v\n", err)
os.Exit(-1)
}
} else { } else {
abi, err = ioutil.ReadFile(*abiFlag) abi, err = ioutil.ReadFile(*abiFlag)
if err != nil { }
fmt.Printf("Failed to read input ABI: %v\n", err) if err != nil {
os.Exit(-1) fmt.Printf("Failed to read input ABI: %v\n", err)
} os.Exit(-1)
} }
abis = append(abis, string(abi)) abis = append(abis, string(abi))