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
Этот коммит содержится в:
коммит произвёл
George Goldberg
родитель
432dc9239f
Коммит
1359f7f391
@@ -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)
|
||||
|
||||
@@ -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"])
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -34,7 +34,7 @@ func TestAppError(t *testing.T) {
|
||||
t.Fatal()
|
||||
}
|
||||
|
||||
err.Error()
|
||||
t.Log(err.Error())
|
||||
}
|
||||
|
||||
func TestAppErrorJunk(t *testing.T) {
|
||||
|
||||
Ссылка в новой задаче
Block a user