mirror of https://github.com/grafana/grafana.git
				
				
				
			Merge variable declaration with assignment (gosimple)
This fixes: pkg/cmd/grafana-cli/commands/upgrade_all_command.go:56:3: should merge variable declaration with assignment on next line (S1021) pkg/login/ldap.go:406:4: should merge variable declaration with assignment on next line (S1021) pkg/services/sqlstore/migrator/dialect.go:87:2: should merge variable declaration with assignment on next line (S1021) pkg/services/sqlstore/migrator/dialect.go:165:2: should merge variable declaration with assignment on next line (S1021) pkg/tsdb/cloudwatch/metric_find_query_test.go:185:2: should merge variable declaration with assignment on next line (S1021)
This commit is contained in:
		
							parent
							
								
									4d6386e97b
								
							
						
					
					
						commit
						5d95601720
					
				|  | @ -53,8 +53,7 @@ func upgradeAllCommand(c CommandLine) error { | |||
| 	for _, p := range pluginsToUpgrade { | ||||
| 		logger.Infof("Updating %v \n", p.Id) | ||||
| 
 | ||||
| 		var err error | ||||
| 		err = s.RemoveInstalledPlugin(pluginsDir, p.Id) | ||||
| 		err := s.RemoveInstalledPlugin(pluginsDir, p.Id) | ||||
| 		if err != nil { | ||||
| 			return err | ||||
| 		} | ||||
|  |  | |||
|  | @ -403,8 +403,7 @@ func (a *ldapAuther) searchForUser(username string) (*LdapUserInfo, error) { | |||
| 		// If we are using a POSIX LDAP schema it won't support memberOf, so we manually search the groups
 | ||||
| 		var groupSearchResult *ldap.SearchResult | ||||
| 		for _, groupSearchBase := range a.server.GroupSearchBaseDNs { | ||||
| 			var filter_replace string | ||||
| 			filter_replace = getLdapAttr(a.server.GroupSearchFilterUserAttribute, searchResult) | ||||
| 			filter_replace := getLdapAttr(a.server.GroupSearchFilterUserAttribute, searchResult) | ||||
| 			if a.server.GroupSearchFilterUserAttribute == "" { | ||||
| 				filter_replace = getLdapAttr(a.server.Attr.Username, searchResult) | ||||
| 			} | ||||
|  |  | |||
|  | @ -84,8 +84,7 @@ func (db *BaseDialect) DateTimeFunc(value string) string { | |||
| } | ||||
| 
 | ||||
| func (b *BaseDialect) CreateTableSql(table *Table) string { | ||||
| 	var sql string | ||||
| 	sql = "CREATE TABLE IF NOT EXISTS " | ||||
| 	sql := "CREATE TABLE IF NOT EXISTS " | ||||
| 	sql += b.dialect.Quote(table.Name) + " (\n" | ||||
| 
 | ||||
| 	pkList := table.PrimaryKeys | ||||
|  | @ -162,8 +161,7 @@ func (db *BaseDialect) RenameTable(oldName string, newName string) string { | |||
| 
 | ||||
| func (db *BaseDialect) DropIndexSql(tableName string, index *Index) string { | ||||
| 	quote := db.dialect.Quote | ||||
| 	var name string | ||||
| 	name = index.XName(tableName) | ||||
| 	name := index.XName(tableName) | ||||
| 	return fmt.Sprintf("DROP INDEX %v ON %s", quote(name), quote(tableName)) | ||||
| } | ||||
| 
 | ||||
|  |  | |||
|  | @ -181,10 +181,7 @@ func TestCloudWatchMetrics(t *testing.T) { | |||
| } | ||||
| 
 | ||||
| func TestParseMultiSelectValue(t *testing.T) { | ||||
| 
 | ||||
| 	var values []string | ||||
| 
 | ||||
| 	values = parseMultiSelectValue(" i-someInstance ") | ||||
| 	values := parseMultiSelectValue(" i-someInstance ") | ||||
| 	assert.Equal(t, []string{"i-someInstance"}, values) | ||||
| 
 | ||||
| 	values = parseMultiSelectValue("{i-05}") | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue