summaryrefslogtreecommitdiffstats
path: root/model
diff options
context:
space:
mode:
Diffstat (limited to 'model')
-rw-r--r--model/job.go4
-rw-r--r--model/user_test.go8
-rw-r--r--model/utils.go16
-rw-r--r--model/utils_test.go2
4 files changed, 15 insertions, 15 deletions
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) {