Run ineffassign against codebase (#12925)

This commit is contained in:
Ben Schumacher
2019-10-29 15:04:28 +01:00
committed by Daniel Schalla
parent 4cc2973483
commit 38c0bde7f8
7 changed files with 9 additions and 9 deletions

View File

@@ -1346,7 +1346,6 @@ func (s *SqlPostStore) GetOldest() (*model.Post, *model.AppError) {
}
func (s *SqlPostStore) determineMaxPostSize() int {
var maxPostSize int = model.POST_MESSAGE_MAX_RUNES_V1
var maxPostSizeBytes int32
if s.DriverName() == model.DATABASE_DRIVER_POSTGRES {
@@ -1384,7 +1383,7 @@ func (s *SqlPostStore) determineMaxPostSize() int {
}
// Assume a worst-case representation of four bytes per rune.
maxPostSize = int(maxPostSizeBytes) / 4
maxPostSize := int(maxPostSizeBytes) / 4
// To maintain backwards compatibility, don't yield a maximum post
// size smaller than the previous limit, even though it wasn't

View File

@@ -699,7 +699,7 @@ func (ss *SqlSupplier) AlterColumnDefaultIfExists(tableName string, columnName s
return false
}
var defaultValue = ""
var defaultValue string
if ss.DriverName() == model.DATABASE_DRIVER_MYSQL {
// Some column types in MySQL cannot have defaults, so don't try to configure anything.
if mySqlColDefault == nil {

View File

@@ -1267,7 +1267,7 @@ func generateSearchQuery(query sq.SelectBuilder, terms []string, fields []string
func (us SqlUserStore) performSearch(query sq.SelectBuilder, term string, options *model.UserSearchOptions) ([]*model.User, *model.AppError) {
term = sanitizeSearchTerm(term, "*")
searchType := USER_SEARCH_TYPE_NAMES_NO_FULL_NAME
var searchType []string
if options.AllowEmails {
if options.AllowFullNames {
searchType = USER_SEARCH_TYPE_ALL