mirror of https://github.com/portainer/portainer
enable gosimple linter (#10744)
parent
d98fc1238e
commit
8396ff068d
|
@ -5,9 +5,11 @@ linters:
|
|||
# Enable these for now
|
||||
enable:
|
||||
- depguard
|
||||
- gosimple
|
||||
- govet
|
||||
- errorlint
|
||||
- exportloopref
|
||||
|
||||
linters-settings:
|
||||
depguard:
|
||||
rules:
|
||||
|
|
|
@ -50,7 +50,7 @@ func TestBackup(t *testing.T) {
|
|||
func TestRestore(t *testing.T) {
|
||||
_, store := MustNewTestStore(t, true, false)
|
||||
|
||||
t.Run(fmt.Sprintf("Basic Restore"), func(t *testing.T) {
|
||||
t.Run("Basic Restore", func(t *testing.T) {
|
||||
// override and set initial db version and edition
|
||||
updateEdition(store, portainer.PortainerCE)
|
||||
updateVersion(store, "2.4")
|
||||
|
@ -64,7 +64,7 @@ func TestRestore(t *testing.T) {
|
|||
testVersion(store, "2.4", t)
|
||||
})
|
||||
|
||||
t.Run(fmt.Sprintf("Basic Restore After Multiple Backups"), func(t *testing.T) {
|
||||
t.Run("Basic Restore After Multiple Backups", func(t *testing.T) {
|
||||
// override and set initial db version and edition
|
||||
updateEdition(store, portainer.PortainerCE)
|
||||
updateVersion(store, "2.4")
|
||||
|
|
|
@ -173,7 +173,7 @@ func (service *Service) GetStackProjectPathByVersion(stackIdentifier string, ver
|
|||
}
|
||||
|
||||
if commitHash != "" {
|
||||
versionStr = fmt.Sprintf("%s", commitHash)
|
||||
versionStr = commitHash
|
||||
}
|
||||
return JoinPaths(service.wrapFileStore(ComposeStorePath), stackIdentifier, versionStr)
|
||||
}
|
||||
|
|
|
@ -147,11 +147,11 @@ func addResourceLabels(yamlDoc interface{}, appLabels map[string]string) {
|
|||
}
|
||||
|
||||
for _, v := range m {
|
||||
switch v.(type) {
|
||||
switch v := v.(type) {
|
||||
case map[string]interface{}:
|
||||
addResourceLabels(v, appLabels)
|
||||
case []interface{}:
|
||||
for _, item := range v.([]interface{}) {
|
||||
for _, item := range v {
|
||||
addResourceLabels(item, appLabels)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue