From 1359f7f3918befd2463103379d17bd2eb846654d Mon Sep 17 00:00:00 2001 From: Corey Hulen Date: Thu, 9 Feb 2017 13:39:15 -0800 Subject: Adding go vet from hack-a-thon (#5328) * Adding go vet to the api package * Adding go vet to app package * Adding go vet to manualtesting package * Adding go vet to the model package * Adding go vet to the store dir * Adding go vet to utils package * Adding missing dirs with go files * Fixing up makefile * Fixing up makefile * Removing root dir --- model/job.go | 4 ++-- model/user_test.go | 8 ++++---- model/utils.go | 16 ++++++++-------- model/utils_test.go | 2 +- 4 files changed, 15 insertions(+), 15 deletions(-) (limited to 'model') diff --git a/model/job.go b/model/job.go index 229d5efd3..09d74aa09 100644 --- a/model/job.go +++ b/model/job.go @@ -14,8 +14,8 @@ type ScheduledTask struct { Name string `json:"name"` Interval time.Duration `json:"interval"` Recurring bool `json:"recurring"` - function TaskFunc `json:",omitempty"` - timer *time.Timer `json:",omitempty"` + function TaskFunc + timer *time.Timer } var tasks = make(map[string]*ScheduledTask) diff --git a/model/user_test.go b/model/user_test.go index 15b1aae6f..4f5c16614 100644 --- a/model/user_test.go +++ b/model/user_test.go @@ -46,25 +46,25 @@ func TestUserUpdateMentionKeysFromUsername(t *testing.T) { user.SetDefaultNotifications() if user.NotifyProps["mention_keys"] != "user,@user" { - t.Fatal("default mention keys are invalid: %v", user.NotifyProps["mention_keys"]) + t.Fatalf("default mention keys are invalid: %v", user.NotifyProps["mention_keys"]) } user.Username = "person" user.UpdateMentionKeysFromUsername("user") if user.NotifyProps["mention_keys"] != "person,@person" { - t.Fatal("mention keys are invalid after changing username: %v", user.NotifyProps["mention_keys"]) + t.Fatalf("mention keys are invalid after changing username: %v", user.NotifyProps["mention_keys"]) } user.NotifyProps["mention_keys"] += ",mention" user.UpdateMentionKeysFromUsername("person") if user.NotifyProps["mention_keys"] != "person,@person,mention" { - t.Fatal("mention keys are invalid after adding extra mention keyword: %v", user.NotifyProps["mention_keys"]) + t.Fatalf("mention keys are invalid after adding extra mention keyword: %v", user.NotifyProps["mention_keys"]) } user.Username = "user" user.UpdateMentionKeysFromUsername("person") if user.NotifyProps["mention_keys"] != "user,@user,mention" { - t.Fatal("mention keys are invalid after changing username with extra mention keyword: %v", user.NotifyProps["mention_keys"]) + t.Fatalf("mention keys are invalid after changing username with extra mention keyword: %v", user.NotifyProps["mention_keys"]) } } diff --git a/model/utils.go b/model/utils.go index 05143b20d..9ecc19595 100644 --- a/model/utils.go +++ b/model/utils.go @@ -34,14 +34,14 @@ type StringArray []string type EncryptStringMap map[string]string type AppError struct { - Id string `json:"id"` - Message string `json:"message"` // Message to be display to the end user without debugging information - DetailedError string `json:"detailed_error"` // Internal error string to help the developer - RequestId string `json:"request_id,omitempty"` // The RequestId that's also set in the header - StatusCode int `json:"status_code,omitempty"` // The http status code - Where string `json:"-"` // The function where it happened in the form of Struct.Func - IsOAuth bool `json:"is_oauth,omitempty"` // Whether the error is OAuth specific - params map[string]interface{} `json:"-"` + Id string `json:"id"` + Message string `json:"message"` // Message to be display to the end user without debugging information + DetailedError string `json:"detailed_error"` // Internal error string to help the developer + RequestId string `json:"request_id,omitempty"` // The RequestId that's also set in the header + StatusCode int `json:"status_code,omitempty"` // The http status code + Where string `json:"-"` // The function where it happened in the form of Struct.Func + IsOAuth bool `json:"is_oauth,omitempty"` // Whether the error is OAuth specific + params map[string]interface{} } func (er *AppError) Error() string { diff --git a/model/utils_test.go b/model/utils_test.go index dbe1e59be..7c6100a04 100644 --- a/model/utils_test.go +++ b/model/utils_test.go @@ -34,7 +34,7 @@ func TestAppError(t *testing.T) { t.Fatal() } - err.Error() + t.Log(err.Error()) } func TestAppErrorJunk(t *testing.T) { -- cgit v1.2.3-1-g7c22