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.
This commit is contained in:
Dave Collins 2014-08-31 18:13:07 -05:00
parent a429bebbba
commit cf4f19dd4c
2 changed files with 5 additions and 2 deletions

View file

@ -116,7 +116,7 @@ func loadConfig() (*flags.Parser, *config, []string, error) {
// here since they will be caught be the final parse below. // here since they will be caught be the final parse below.
preCfg := cfg preCfg := cfg
preParser := flags.NewParser(&preCfg, flags.None) preParser := flags.NewParser(&preCfg, flags.None)
preParser.Parse() _, _ = preParser.Parse()
// Show the version and exit if the version flag was specified. // Show the version and exit if the version flag was specified.
if preCfg.ShowVersion { if preCfg.ShowVersion {

View file

@ -65,7 +65,10 @@ func normalizeVerString(str string) string {
var result bytes.Buffer var result bytes.Buffer
for _, r := range str { for _, r := range str {
if strings.ContainsRune(semanticAlphabet, r) { 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() return result.String()