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 vet error #1968

Merged
merged 1 commit into from
Mar 16, 2015
Merged

fix vet error #1968

merged 1 commit into from
Mar 16, 2015

Conversation

corylanou
Copy link
Contributor

Master was currently giving me this vet error:

$ go vet ./...
stats_test.go:86: arg bar for printf verb %s of wrong type: *github.com/influxdb/influxdb.Stats
exit status 1

I'm not sure how this was passing travis/circle on the servers.

Merging on green.

cc @otoolep

@@ -83,6 +83,6 @@ func TestStats_Snapshot(t *testing.T) {

bar := foo.Snapshot()
if bar.Name() != "server" || bar.Get("a") != 100 || bar.Get("b") != 600 {
t.Fatalf("stats snapshot returned unexpected result: %s", bar)
t.Fatalf("stats snapshot returned unexpected result: %#v", bar)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does # mean?

@otoolep
Copy link
Contributor

otoolep commented Mar 16, 2015

Assuming # is not an error, +1. Thanks @corylanou

@corylanou
Copy link
Contributor Author

%#v will print type/field information, helpful in debugging.

package main

import "fmt"

func main() {
    foo := struct {
        name string
        id   int
    }{
        name: "Joe",
        id:   1,
    }
    fmt.Printf("%v\n", foo)
    fmt.Printf("%#v\n", foo)
}

Outputs:

{Joe 1}
struct { name string; id int }{name:"Joe", id:1}

http://play.golang.org/p/Q547_JRMlt

My bigger concern wasn't that we had a vet error, but that travis/circle didn't go red.

@corylanou
Copy link
Contributor Author

The test failure is due to #1962, and I can't fix that until this is merged, so merging this even with a failed integration check.

corylanou added a commit that referenced this pull request Mar 16, 2015
@corylanou corylanou merged commit 369ead2 into master Mar 16, 2015
@corylanou corylanou deleted the fix-vet branch March 16, 2015 15:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants