Unverified Commit c5e8cb25 authored by Chris's avatar Chris Committed by GitHub

simplify things (#7735)

parent 63df41b9
......@@ -206,7 +206,7 @@ func TestCreateEmoji(t *testing.T) {
CreatorId: th.BasicUser.Id,
Name: model.NewId(),
}
if _, err := Client.CreateEmoji(emoji, make([]byte, 100, 100), "image.gif"); err == nil {
if _, err := Client.CreateEmoji(emoji, make([]byte, 100), "image.gif"); err == nil {
t.Fatal("shouldn't be able to create an emoji with non-image data")
}
......
......@@ -1321,7 +1321,7 @@ func TestGetFileInfosForPost(t *testing.T) {
Client := th.BasicClient
channel1 := th.BasicChannel
fileIds := make([]string, 3, 3)
fileIds := make([]string, 3)
if data, err := readTestFile("test.png"); err != nil {
t.Fatal(err)
} else {
......@@ -1531,7 +1531,7 @@ func TestPinPost(t *testing.T) {
if rupost1, err := Client.PinPost(post.ChannelId, post.Id); err != nil {
t.Fatal(err)
} else {
if rupost1.Data.(*model.Post).IsPinned != true {
if !rupost1.Data.(*model.Post).IsPinned {
t.Fatal("failed to pin post")
}
}
......@@ -1540,7 +1540,7 @@ func TestPinPost(t *testing.T) {
if rupost2, err := Client.PinPost(pinnedPost.ChannelId, pinnedPost.Id); err != nil {
t.Fatal(err)
} else {
if rupost2.Data.(*model.Post).IsPinned != true {
if !rupost2.Data.(*model.Post).IsPinned {
t.Fatal("pinning a post should be idempotent")
}
}
......@@ -1556,7 +1556,7 @@ func TestUnpinPost(t *testing.T) {
if rupost1, err := Client.UnpinPost(pinnedPost.ChannelId, pinnedPost.Id); err != nil {
t.Fatal(err)
} else {
if rupost1.Data.(*model.Post).IsPinned != false {
if rupost1.Data.(*model.Post).IsPinned {
t.Fatal("failed to unpin post")
}
}
......@@ -1565,7 +1565,7 @@ func TestUnpinPost(t *testing.T) {
if rupost2, err := Client.UnpinPost(post.ChannelId, post.Id); err != nil {
t.Fatal(err)
} else {
if rupost2.Data.(*model.Post).IsPinned != false {
if rupost2.Data.(*model.Post).IsPinned {
t.Fatal("unpinning a post should be idempotent")
}
}
......
......@@ -1167,7 +1167,6 @@ func completeSaml(c *Context, w http.ResponseWriter, r *http.Request) {
c.App.AddDirectChannels(teamId, user)
})
}
break
case model.OAUTH_ACTION_EMAIL_TO_SSO:
if err := c.App.RevokeAllSessions(user.Id); err != nil {
c.Err = err
......@@ -1179,7 +1178,6 @@ func completeSaml(c *Context, w http.ResponseWriter, r *http.Request) {
l4g.Error(err.Error())
}
})
break
}
doLogin(c, w, r, user, "")
if c.Err != nil {
......
......@@ -322,7 +322,6 @@ func getChannel(c *Context, w http.ResponseWriter, r *http.Request) {
}
w.Write([]byte(channel.ToJson()))
return
}
func getChannelUnread(c *Context, w http.ResponseWriter, r *http.Request) {
......@@ -601,7 +600,6 @@ func getChannelByNameForTeamName(c *Context, w http.ResponseWriter, r *http.Requ
}
w.Write([]byte(channel.ToJson()))
return
}
func getChannelMembers(c *Context, w http.ResponseWriter, r *http.Request) {
......
......@@ -127,7 +127,7 @@ func TestCreateEmoji(t *testing.T) {
Name: model.NewId(),
}
_, resp = Client.CreateEmoji(emoji, make([]byte, 100, 100), "image.gif")
_, resp = Client.CreateEmoji(emoji, make([]byte, 100), "image.gif")
CheckBadRequestStatus(t, resp)
CheckErrorMessage(t, resp, "api.emoji.upload.image.app_error")
......@@ -232,7 +232,7 @@ func TestDeleteEmoji(t *testing.T) {
ok, resp := Client.DeleteEmoji(newEmoji.Id)
CheckNoError(t, resp)
if ok != true {
if !ok {
t.Fatal("should return true")
} else {
_, err := Client.GetEmoji(newEmoji.Id)
......@@ -247,7 +247,7 @@ func TestDeleteEmoji(t *testing.T) {
ok, resp = th.SystemAdminClient.DeleteEmoji(newEmoji.Id)
CheckNoError(t, resp)
if ok != true {
if !ok {
t.Fatal("should return true")
} else {
_, err := th.SystemAdminClient.GetEmoji(newEmoji.Id)
......
......@@ -151,7 +151,7 @@ func TestGetFile(t *testing.T) {
data, resp := Client.GetFile(fileId)
CheckNoError(t, resp)
if data == nil || len(data) == 0 {
if len(data) == 0 {
t.Fatal("should not be empty")
}
......@@ -268,7 +268,7 @@ func TestGetFileThumbnail(t *testing.T) {
data, resp := Client.GetFileThumbnail(fileId)
CheckNoError(t, resp)
if data == nil || len(data) == 0 {
if len(data) == 0 {
t.Fatal("should not be empty")
}
......@@ -395,7 +395,7 @@ func TestGetFilePreview(t *testing.T) {
data, resp := Client.GetFilePreview(fileId)
CheckNoError(t, resp)
if data == nil || len(data) == 0 {
if len(data) == 0 {
t.Fatal("should not be empty")
}
......
......@@ -572,7 +572,7 @@ func TestPatchPost(t *testing.T) {
rpost, resp := Client.PatchPost(post.Id, patch)
CheckNoError(t, resp)
if rpost.IsPinned != false {
if rpost.IsPinned {
t.Fatal("IsPinned did not update properly")
}
if rpost.Message != "#otherhashtag other message" {
......@@ -593,7 +593,7 @@ func TestPatchPost(t *testing.T) {
if !reflect.DeepEqual(rpost.FileIds, *patch.FileIds) {
t.Fatal("FileIds did not update properly")
}
if rpost.HasReactions != false {
if rpost.HasReactions {
t.Fatal("HasReactions did not update properly")
}
......@@ -642,7 +642,7 @@ func TestPinPost(t *testing.T) {
t.Fatal("should have passed")
}
if rpost, err := th.App.GetSinglePost(post.Id); err != nil && rpost.IsPinned != true {
if rpost, err := th.App.GetSinglePost(post.Id); err != nil && !rpost.IsPinned {
t.Fatal("failed to pin post")
}
......@@ -677,7 +677,7 @@ func TestUnpinPost(t *testing.T) {
t.Fatal("should have passed")
}
if rpost, err := th.App.GetSinglePost(pinnedPost.Id); err != nil && rpost.IsPinned != false {
if rpost, err := th.App.GetSinglePost(pinnedPost.Id); err != nil && rpost.IsPinned {
t.Fatal("failed to pin post")
}
......@@ -1157,7 +1157,7 @@ func TestDeletePost(t *testing.T) {
CheckUnauthorizedStatus(t, resp)
status, resp := th.SystemAdminClient.DeletePost(post.Id)
if status == false {
if !status {
t.Fatal("post should return status OK")
}
CheckNoError(t, resp)
......@@ -1443,7 +1443,7 @@ func TestGetFileInfosForPost(t *testing.T) {
defer th.TearDown()
Client := th.Client
fileIds := make([]string, 3, 3)
fileIds := make([]string, 3)
if data, err := readTestFile("test.png"); err != nil {
t.Fatal(err)
} else {
......
......@@ -87,13 +87,13 @@ func TestReloadConfig(t *testing.T) {
flag, resp := Client.ReloadConfig()
CheckForbiddenStatus(t, resp)
if flag == true {
if flag {
t.Fatal("should not Reload the config due no permission.")
}
flag, resp = th.SystemAdminClient.ReloadConfig()
CheckNoError(t, resp)
if flag == false {
if !flag {
t.Fatal("should Reload the config")
}
......@@ -285,13 +285,13 @@ func TestInvalidateCaches(t *testing.T) {
flag, resp := Client.InvalidateCaches()
CheckForbiddenStatus(t, resp)
if flag == true {
if flag {
t.Fatal("should not clean the cache due no permission.")
}
flag, resp = th.SystemAdminClient.InvalidateCaches()
CheckNoError(t, resp)
if flag == false {
if !flag {
t.Fatal("should clean the cache")
}
}
......
......@@ -604,7 +604,6 @@ func teamExists(c *Context, w http.ResponseWriter, r *http.Request) {
}
w.Write([]byte(model.MapBoolToJson(resp)))
return
}
func importTeam(c *Context, w http.ResponseWriter, r *http.Request) {
......
......@@ -282,7 +282,7 @@ func TestUpdateTeam(t *testing.T) {
uteam, resp = Client.UpdateTeam(team)
CheckNoError(t, resp)
if uteam.AllowOpenInvite != true {
if !uteam.AllowOpenInvite {
t.Fatal("Update failed")
}
......@@ -419,7 +419,7 @@ func TestPatchTeam(t *testing.T) {
if rteam.InviteId != "inviteid1" {
t.Fatal("InviteId did not update properly")
}
if rteam.AllowOpenInvite != true {
if !rteam.AllowOpenInvite {
t.Fatal("AllowOpenInvite did not update properly")
}
......@@ -1780,13 +1780,13 @@ func TestTeamExists(t *testing.T) {
exists, resp := Client.TeamExists(team.Name, "")
CheckNoError(t, resp)
if exists != true {
if !exists {
t.Fatal("team should exist")
}
exists, resp = Client.TeamExists("testingteam", "")
CheckNoError(t, resp)
if exists != false {
if exists {
t.Fatal("team should not exist")
}
......@@ -1889,7 +1889,7 @@ func TestInviteUsersToTeam(t *testing.T) {
okMsg, resp := th.SystemAdminClient.InviteUsersToTeam(th.BasicTeam.Id, emailList)
CheckNoError(t, resp)
if okMsg != true {
if !okMsg {
t.Fatal("should return true")
}
......
......@@ -821,7 +821,7 @@ func TestGetProfileImage(t *testing.T) {
data, resp := Client.GetProfileImage(user.Id, "")
CheckNoError(t, resp)
if data == nil || len(data) == 0 {
if len(data) == 0 {
t.Fatal("Should not be empty")
}
......@@ -1860,7 +1860,7 @@ func TestRevokeSessions(t *testing.T) {
CheckBadRequestStatus(t, resp)
status, resp := Client.RevokeSession(user.Id, session.Id)
if status == false {
if !status {
t.Fatal("user session revoke unsuccessful")
}
CheckNoError(t, resp)
......@@ -1912,7 +1912,7 @@ func TestRevokeAllSessions(t *testing.T) {
CheckBadRequestStatus(t, resp)
status, resp := Client.RevokeAllSessions(user.Id)
if status == false {
if !status {
t.Fatal("user all sessions revoke unsuccessful")
}
CheckNoError(t, resp)
......
......@@ -65,7 +65,7 @@ func (cfg *AutoChannelCreator) CreateTestChannels(num utils.Range) ([]*model.Cha
for i := 0; i < numChannels; i++ {
var err bool
channels[i], err = cfg.createRandomChannel()
if err != true {
if !err {
return channels, false
}
}
......
......@@ -22,7 +22,7 @@ func CreateTestEnvironmentWithTeams(a *App, client *model.Client, rangeTeams uti
teamCreator := NewAutoTeamCreator(client)
teamCreator.Fuzzy = fuzzy
teams, err := teamCreator.CreateTestTeams(rangeTeams)
if err != true {
if !err {
return TestEnvironment{}, false
}
......@@ -32,13 +32,13 @@ func CreateTestEnvironmentWithTeams(a *App, client *model.Client, rangeTeams uti
userCreator := NewAutoUserCreator(a, client, team)
userCreator.Fuzzy = fuzzy
randomUser, err := userCreator.createRandomUser()
if err != true {
if !err {
return TestEnvironment{}, false
}
client.LoginById(randomUser.Id, USER_PASSWORD)
client.SetTeamId(team.Id)
teamEnvironment, err := CreateTestEnvironmentInTeam(a, client, team, rangeChannels, rangeUsers, rangePosts, fuzzy)
if err != true {
if !err {
return TestEnvironment{}, false
}
environment.Environments[i] = teamEnvironment
......@@ -58,7 +58,7 @@ func CreateTestEnvironmentInTeam(a *App, client *model.Client, team *model.Team,
userCreator := NewAutoUserCreator(a, client, team)
userCreator.Fuzzy = fuzzy
users, err := userCreator.CreateTestUsers(rangeUsers)
if err != true {
if !err {
return TeamEnvironment{}, false
}
usernames := make([]string, len(users))
......@@ -78,7 +78,7 @@ func CreateTestEnvironmentInTeam(a *App, client *model.Client, team *model.Team,
}
}
if err != true {
if !err {
return TeamEnvironment{}, false
}
......
......@@ -65,7 +65,7 @@ func (cfg *AutoPostCreator) CreateRandomPost() (*model.Post, bool) {
if cfg.HasImage {
var err1 bool
fileIds, err1 = cfg.UploadTestFile()
if err1 == false {
if !err1 {
return nil, false
}
}
......@@ -95,7 +95,7 @@ func (cfg *AutoPostCreator) CreateTestPosts(rangePosts utils.Range) ([]*model.Po
for i := 0; i < numPosts; i++ {
var err bool
posts[i], err = cfg.CreateRandomPost()
if err != true {
if !err {
return posts, false
}
}
......
......@@ -72,7 +72,7 @@ func (cfg *AutoTeamCreator) CreateTestTeams(num utils.Range) ([]*model.Team, boo
for i := 0; i < numTeams; i++ {
var err bool
teams[i], err = cfg.createRandomTeam()
if err != true {
if !err {
return teams, false
}
}
......
......@@ -38,7 +38,7 @@ func NewAutoUserCreator(a *App, client *model.Client, team *model.Team) *AutoUse
// Basic test team and user so you always know one
func (a *App) CreateBasicUser(client *model.Client) *model.AppError {
result, _ := client.FindTeamByName(BTEST_TEAM_NAME)
if result.Data.(bool) == false {
if !result.Data.(bool) {
newteam := &model.Team{DisplayName: BTEST_TEAM_DISPLAY_NAME, Name: BTEST_TEAM_NAME, Email: BTEST_TEAM_EMAIL, Type: BTEST_TEAM_TYPE}
result, err := client.CreateTeam(newteam)
if err != nil {
......@@ -102,7 +102,7 @@ func (cfg *AutoUserCreator) CreateTestUsers(num utils.Range) ([]*model.User, boo
for i := 0; i < numUsers; i++ {
var err bool
users[i], err = cfg.createRandomUser()
if err != true {
if !err {
return users, false
}
}
......
......@@ -53,7 +53,7 @@ func (me *EchoProvider) DoCommand(a *App, args *model.CommandArgs, message strin
delay = checkDelay
}
message = message[1:endMsg]
} else if strings.Index(message, " ") > -1 {
} else if strings.Contains(message, " ") {
delayIdx := strings.LastIndex(message, " ")
delayStr := strings.Trim(message[delayIdx:], " ")
......
......@@ -173,7 +173,7 @@ func (me *LoadTestProvider) SetupCommand(a *App, args *model.CommandArgs, messag
utils.Range{Begin: numUsers, End: numUsers},
utils.Range{Begin: numPosts, End: numPosts},
doFuzz)
if err != true {
if !err {
return &model.CommandResponse{Text: "Failed to create testing environment", ResponseType: model.COMMAND_RESPONSE_TYPE_EPHEMERAL}
} else {
l4g.Info("Testing environment created")
......@@ -216,7 +216,7 @@ func (me *LoadTestProvider) UsersCommand(a *App, args *model.CommandArgs, messag
}
usersr, err := parseRange(cmd, "")
if err == false {
if !err {
usersr = utils.Range{Begin: 2, End: 5}
}
......@@ -246,7 +246,7 @@ func (me *LoadTestProvider) ChannelsCommand(a *App, args *model.CommandArgs, mes
}
channelsr, err := parseRange(cmd, "")
if err == false {
if !err {
channelsr = utils.Range{Begin: 2, End: 5}
}
......@@ -277,7 +277,7 @@ func (me *LoadTestProvider) PostsCommand(a *App, args *model.CommandArgs, messag
}
postsr, err := parseRange(cmd, "")
if err == false {
if !err {
postsr = utils.Range{Begin: 20, End: 30}
}
......
......@@ -86,10 +86,7 @@ func SendDiagnostic(event string, properties map[string]interface{}) {
}
func isDefault(setting interface{}, defaultValue interface{}) bool {
if setting == defaultValue {
return true
}
return false
return setting == defaultValue
}
func pluginSetting(pluginSettings *model.PluginSettings, plugin, key string, defaultValue interface{}) interface{} {
......
......@@ -184,7 +184,7 @@ func TestCheckPendingNotifications(t *testing.T) {
if post.Message != "post1" {
t.Fatal("should've received post1 first")
}
case _ = <-timeout:
case <-timeout:
t.Fatal("timed out waiting for first post notification")
}
......@@ -193,7 +193,7 @@ func TestCheckPendingNotifications(t *testing.T) {
if post.Message != "post2" {
t.Fatal("should've received post2 second")
}
case _ = <-timeout:
case <-timeout:
t.Fatal("timed out waiting for second post notification")
}
}
......
......@@ -849,7 +849,7 @@ func (a *App) ImportUserChannels(user *model.User, team *model.Team, teamMember
}
}
if cdata.Favorite != nil && *cdata.Favorite == true {
if cdata.Favorite != nil && *cdata.Favorite {
preferences = append(preferences, model.Preference{
UserId: user.Id,
Category: model.PREFERENCE_CATEGORY_FAVORITE_CHANNEL,
......
......@@ -267,7 +267,7 @@ func (a *App) createSessionForUserAccessToken(tokenString string) (*model.Sessio
} else {
token = result.Data.(*model.UserAccessToken)
if token.IsActive == false {
if !token.IsActive {
return nil, model.NewAppError("createSessionForUserAccessToken", "app.user_access_token.invalid_or_missing", nil, "inactive_token", http.StatusUnauthorized)
}
}
......
......@@ -243,7 +243,7 @@ func (a *App) SlackAddPosts(teamId string, channel *model.Channel, posts []Slack
CreateAt: SlackConvertTimeStamp(sPost.TimeStamp),
}
if sPost.Upload {
if fileInfo, ok := a.SlackUploadFile(sPost, uploads, teamId, newPost.ChannelId, newPost.UserId); ok == true {
if fileInfo, ok := a.SlackUploadFile(sPost, uploads, teamId, newPost.ChannelId, newPost.UserId); ok {
newPost.FileIds = append(newPost.FileIds, fileInfo.Id)
newPost.Message = sPost.File.Title
}
......@@ -395,7 +395,7 @@ func (a *App) SlackAddPosts(teamId string, channel *model.Channel, posts []Slack
func (a *App) SlackUploadFile(sPost SlackPost, uploads map[string]*zip.File, teamId string, channelId string, userId string) (*model.FileInfo, bool) {
if sPost.File != nil {
if file, ok := uploads[sPost.File.Id]; ok == true {
if file, ok := uploads[sPost.File.Id]; ok {
openFile, err := file.Open()
if err != nil {
l4g.Warn(utils.T("api.slackimport.slack_add_posts.upload_file_open_failed.warn", map[string]interface{}{"FileId": sPost.File.Id, "Error": err.Error()}))
......@@ -655,7 +655,7 @@ func (a *App) SlackImport(fileData multipart.File, fileSize int64, teamID string
if len(spl) == 2 && strings.HasSuffix(spl[1], ".json") {
newposts, _ := SlackParsePosts(reader)
channel := spl[0]
if _, ok := posts[channel]; ok == false {
if _, ok := posts[channel]; !ok {
posts[channel] = newposts
} else {
posts[channel] = append(posts[channel], newposts...)
......
......@@ -864,11 +864,7 @@ func (a *App) UpdatePasswordAsUser(userId, currentPassword, newPassword string)
T := utils.GetUserTranslations(user.Locale)
if err := a.UpdatePasswordSendEmail(user, newPassword, T("api.user.update_password.menu")); err != nil {
return err
}
return nil
return a.UpdatePasswordSendEmail(user, newPassword, T("api.user.update_password.menu"))
}
func (a *App) UpdateActiveNoLdap(userId string, active bool) (*model.User, *model.AppError) {
......@@ -1353,11 +1349,7 @@ func (a *App) GetVerifyEmailToken(token string) (*model.Token, *model.AppError)
}
func (a *App) VerifyUserEmail(userId string) *model.AppError {
if err := (<-a.Srv.Store.User().VerifyEmail(userId)).Err; err != nil {
return err
}
return nil
return (<-a.Srv.Store.User().VerifyEmail(userId)).Err
}
func (a *App) SearchUsers(props *model.UserSearch, searchOptions map[string]bool, asAdmin bool) ([]*model.User, *model.AppError) {
......
......@@ -98,7 +98,7 @@ func (a *App) HubStart() {
splits := strings.Split(output, "goroutine ")
for _, part := range splits {
if strings.Index(part, fmt.Sprintf("%v", hub.goroutineId)) > -1 {
if strings.Contains(part, fmt.Sprintf("%v", hub.goroutineId)) {
l4g.Error("Trace for possible deadlock goroutine %v", part)
}
}
......
......@@ -597,11 +597,8 @@ func (a *App) HandleIncomingWebhook(hookId string, req *model.IncomingWebhookReq
overrideUsername := req.Username
overrideIconUrl := req.IconURL
if _, err := a.CreateWebhookPost(hook.UserId, channel, text, overrideUsername, overrideIconUrl, req.Props, webhookType); err != nil {
return err
}
return nil
_, err := a.CreateWebhookPost(hook.UserId, channel, text, overrideUsername, overrideIconUrl, req.Props, webhookType)
return err
}
func (a *App) CreateCommandWebhook(commandId string, args *model.CommandArgs) (*model.CommandWebhook, *model.AppError) {
......
......@@ -61,9 +61,5 @@ func moveCommandCmdF(cmd *cobra.Command, args []string) error {
}
func moveCommand(a *app.App, team *model.Team, command *model.Command) *model.AppError {
if err := a.MoveCommand(team, command); err != nil {
return err
}
return nil
return a.MoveCommand(team, command)
}
......@@ -40,7 +40,7 @@ func (watcher *Watcher) Start() {
// Delay for some random number of milliseconds before starting to ensure that multiple
// instances of the jobserver don't poll at a time too close to each other.
rand.Seed(time.Now().UTC().UnixNano())
_ = <-time.After(time.Duration(rand.Intn(watcher.pollingInterval)) * time.Millisecond)
<-time.After(time.Duration(rand.Intn(watcher.pollingInterval)) * time.Millisecond)
defer func() {
l4g.Debug("Watcher Finished")
......
......@@ -25,7 +25,7 @@ https://medium.com/@slackhq/11-useful-tips-for-getting-the-most-of-slack-5dfb3d1
func testAutoLink(env TestEnvironment) *model.AppError {
l4g.Info(utils.T("manaultesting.test_autolink.info"))
channelID, err := getChannelID(env.Context.App, model.DEFAULT_CHANNEL, env.CreatedTeamId, env.CreatedUserId)
if err != true {
if !err {
return model.NewAppError("/manualtest", "manaultesting.test_autolink.unable.app_error", nil, "", http.StatusInternalServerError)
}
......@@ -33,9 +33,5 @@ func testAutoLink(env TestEnvironment) *model.AppError {
ChannelId: channelID,
Message: LINK_POST_TEXT}
_, err2 := env.Client.CreatePost(post)
if err2 != nil {
return err2
}
return nil
return err2
}
......@@ -155,10 +155,5 @@ func AuthorizeRequestFromJson(data io.Reader) *AuthorizeRequest {
}
func (ad *AuthData) IsExpired() bool {
if GetMillis() > ad.CreateAt+int64(ad.ExpiresIn*1000) {
return true
}
return false
return GetMillis() > ad.CreateAt+int64(ad.ExpiresIn*1000)
}
......@@ -44,7 +44,7 @@ func BuildErrorResponse(r *http.Response, err *AppError) *Response {
header = r.Header
} else {
statusCode = 0
header = make(http.Header, 0)
header = make(http.Header)
}
return &Response{
......
......@@ -850,12 +850,7 @@ func (o *Config) SetDefaults() {
if o.EmailSettings.EnableSignInWithEmail == nil {
o.EmailSettings.EnableSignInWithEmail = new(bool)
if o.EmailSettings.EnableSignUpWithEmail == true {
*o.EmailSettings.EnableSignInWithEmail = true
} else {
*o.EmailSettings.EnableSignInWithEmail = false
}
*o.EmailSettings.EnableSignInWithEmail = o.EmailSettings.EnableSignUpWithEmail
}
if o.EmailSettings.EnableSignInWithUsername == nil {
......
......@@ -29,7 +29,7 @@ func TestConfigDefaultFileSettingsS3SSE(t *testing.T) {
c1 := Config{}
c1.SetDefaults()
if *c1.FileSettings.AmazonS3SSE != false {
if *c1.FileSettings.AmazonS3SSE {
t.Fatal("FileSettings.AmazonS3SSE should default to false")
}
}
......@@ -155,19 +155,11 @@ func (f *Features) SetDefaults() {
}
func (l *License) IsExpired() bool {
now := GetMillis()