Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix some go style mistakes about fmt.Errorf #16

Merged
merged 2 commits into from
Jan 4, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions cmd/sidecar-e2e/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ func waitForTcpOrExit(cmd *exec.Cmd, endpoint string) error {
// Check to see that the process has not died early.
select {
case err := <-exitChan:
return true, fmt.Errorf("Process died: %v", err)
return true, fmt.Errorf("process died: %v", err)
default:
}

Expand Down Expand Up @@ -400,7 +400,7 @@ func (t *test) runDig() {
if err == nil {
t.digOutput += string(output)
} else {
t.errors = append(t.errors, fmt.Errorf("Error running dig: %v", err))
t.errors = append(t.errors, fmt.Errorf("error running dig: %v", err))
}
}
}
Expand Down Expand Up @@ -517,6 +517,6 @@ func main() {
break

default:
log.Fatal(fmt.Errorf("Invalid --mode: %v", opts.mode))
log.Fatal(fmt.Errorf("invalid --mode: %v", opts.mode))
}
}
6 changes: 3 additions & 3 deletions pkg/dnsmasq/dnsmasq.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,14 +105,14 @@ func (mc *metricsClient) getSingleMetric(name string) (int64, error) {
}

if len(in.Answer) != 1 {
return 0, fmt.Errorf("Invalid number of Answer records for %s: %d",
return 0, fmt.Errorf("invalid number of Answer records for %s: %d",
name, len(in.Answer))
}

if t, ok := in.Answer[0].(*dns.TXT); ok {
glog.V(4).Infof("Got valid TXT response %+v for %s", t, name)
if len(t.Txt) != 1 {
return 0, fmt.Errorf("Invalid number of TXT records for %s: %d",
return 0, fmt.Errorf("invalid number of TXT records for %s: %d",
name, len(t.Txt))
}

Expand All @@ -124,5 +124,5 @@ func (mc *metricsClient) getSingleMetric(name string) (int64, error) {
return value, nil
}

return 0, fmt.Errorf("missing txt record for %s", name)
return 0, fmt.Errorf("missing TXT record for %s", name)
}