From cf4f19dd4cf42db2b0da0582023ccc6ef7a86b97 Mon Sep 17 00:00:00 2001 From: Dave Collins Date: Sun, 31 Aug 2014 18:13:07 -0500 Subject: [PATCH] Make btcctl errcheck clean. This commit explicitly ignores errors that were already intentionally ignored in btcctl by using an _ to make the errcheck utility happy. It is also nice to make it explicit that the error is being ignored intentionally rather than leave questions of whether it was accidentally forgotten. --- util/btcctl/config.go | 2 +- util/btcctl/version.go | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/util/btcctl/config.go b/util/btcctl/config.go index 553fde44..27e670fc 100644 --- a/util/btcctl/config.go +++ b/util/btcctl/config.go @@ -116,7 +116,7 @@ func loadConfig() (*flags.Parser, *config, []string, error) { // here since they will be caught be the final parse below. preCfg := cfg preParser := flags.NewParser(&preCfg, flags.None) - preParser.Parse() + _, _ = preParser.Parse() // Show the version and exit if the version flag was specified. if preCfg.ShowVersion { diff --git a/util/btcctl/version.go b/util/btcctl/version.go index c947516b..2c9bc639 100644 --- a/util/btcctl/version.go +++ b/util/btcctl/version.go @@ -65,7 +65,10 @@ func normalizeVerString(str string) string { var result bytes.Buffer for _, r := range str { if strings.ContainsRune(semanticAlphabet, r) { - result.WriteRune(r) + // Ignoring the error here since it can only fail if + // the the system is out of memory and there are much + // bigger issues at that point. + _, _ = result.WriteRune(r) } } return result.String()