Skip to content

Commit

Permalink
Make btcctl errcheck clean.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
davecgh committed Aug 31, 2014
1 parent a429beb commit cf4f19d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion util/btcctl/config.go
Expand Up @@ -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 {
Expand Down
5 changes: 4 additions & 1 deletion util/btcctl/version.go
Expand Up @@ -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()
Expand Down

0 comments on commit cf4f19d

Please sign in to comment.