From bb7c1460927e1c999d7b7434682977ea008465a7 Mon Sep 17 00:00:00 2001 From: Kegan Dougal Date: Fri, 6 Jan 2017 15:33:33 +0000 Subject: [PATCH] Actually run all the golint tests --- client_examples_test.go | 2 +- hooks/pre-commit | 2 +- userids.go | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/client_examples_test.go b/client_examples_test.go index 57a8d9f..e3c0f09 100644 --- a/client_examples_test.go +++ b/client_examples_test.go @@ -77,7 +77,7 @@ func ExampleClient_BuildBaseURL() { // Retrieve the content of a m.room.name state event. func ExampleClient_StateEvent() { content := struct { - name string `json:"name"` + Name string `json:"name"` }{} cli, _ := NewClient("https://matrix.org", "@example:matrix.org", "abcdef123456") if err := cli.StateEvent("!foo:bar", "m.room.name", "", &content); err != nil { diff --git a/hooks/pre-commit b/hooks/pre-commit index 6a14ccf..41df674 100755 --- a/hooks/pre-commit +++ b/hooks/pre-commit @@ -4,6 +4,6 @@ set -eu golint go fmt -go tool vet --shadow . +go tool vet --all --shadow . gocyclo -over 12 . go test -timeout 5s -test.v diff --git a/userids.go b/userids.go index 817a006..23e7807 100644 --- a/userids.go +++ b/userids.go @@ -121,7 +121,7 @@ func DecodeUserLocalpart(str string) (string, error) { // See http://matrix.org/docs/spec/intro.html#user-identifiers func ExtractUserLocalpart(userID string) (string, error) { if len(userID) == 0 || userID[0] != '@' { - return "", fmt.Errorf("%s is not a valid user id") + return "", fmt.Errorf("%s is not a valid user id", userID) } return strings.TrimPrefix( strings.SplitN(userID, ":", 2)[0], // @foo:bar:8448 => [ "@foo", "bar:8448" ]