Commit 5e60d16f authored by Marten Seemann's avatar Marten Seemann

fix ineffectual assignment of error

parent 9592ea17
...@@ -36,19 +36,19 @@ Options: ...@@ -36,19 +36,19 @@ Options:
addrStr := flag.Args()[0] addrStr := flag.Args()[0]
var addr maddr.Multiaddr var addr maddr.Multiaddr
var err error var merr error
if strings.HasPrefix(addrStr, "0x") { if strings.HasPrefix(addrStr, "0x") {
addrBytes, err := hex.DecodeString(addrStr[2:]) addrBytes, err := hex.DecodeString(addrStr[2:])
if err != nil { if err != nil {
fmt.Fprintf(os.Stderr, "parse error: %s\n", err) fmt.Fprintf(os.Stderr, "parse error: %s\n", err)
os.Exit(1) os.Exit(1)
} }
addr, err = maddr.NewMultiaddrBytes(addrBytes) addr, merr = maddr.NewMultiaddrBytes(addrBytes)
} else { } else {
addr, err = maddr.NewMultiaddr(addrStr) addr, merr = maddr.NewMultiaddr(addrStr)
} }
if err != nil { if merr != nil {
fmt.Fprintf(os.Stderr, "parse error: %s\n", err) fmt.Fprintf(os.Stderr, "parse error: %s\n", merr)
os.Exit(1) os.Exit(1)
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment