fix a few go-vet errors

This commit is contained in:
Tim Hockin
2016-02-09 13:20:31 -08:00
parent ee54afc9ed
commit 7cab7bd472
10 changed files with 20 additions and 21 deletions

View File

@@ -673,7 +673,7 @@ func TestReload(t *testing.T) {
// EnsureChain
func() ([]byte, error) { return []byte{}, nil },
// EnsureRule abc check
func() ([]byte, error) { return []byte{}, &exec.FakeExitError{1} },
func() ([]byte, error) { return []byte{}, &exec.FakeExitError{Status: 1} },
// EnsureRule abc
func() ([]byte, error) { return []byte{}, nil },
@@ -681,7 +681,7 @@ func TestReload(t *testing.T) {
// EnsureChain
func() ([]byte, error) { return []byte{}, nil },
// EnsureRule abc check
func() ([]byte, error) { return []byte{}, &exec.FakeExitError{1} },
func() ([]byte, error) { return []byte{}, &exec.FakeExitError{Status: 1} },
// EnsureRule abc
func() ([]byte, error) { return []byte{}, nil },
},

View File

@@ -102,7 +102,7 @@ func ParsePortRange(value string) (*PortRange, error) {
func ParsePortRangeOrDie(value string) *PortRange {
pr, err := ParsePortRange(value)
if err != nil {
panic(fmt.Sprintf("couldn't parse port range: %v"))
panic(fmt.Sprintf("couldn't parse port range %q: %v", value, err))
}
return pr
}

View File

@@ -120,8 +120,7 @@ func (t ErrorType) String() string {
case ErrorTypeInternal:
return "Internal error"
default:
panic(fmt.Sprintf("unrecognized validation error: %q", t))
return ""
panic(fmt.Sprintf("unrecognized validation error: %q", string(t)))
}
}