Skip to content

Commit d0a4d00

Browse files
committed
fix(config): remove unused variables
Signed-off-by: Nicklas Frahm <[email protected]>
1 parent 92651ed commit d0a4d00

File tree

1 file changed

+11
-21
lines changed

1 file changed

+11
-21
lines changed

config/config.go

+11-21
Original file line numberDiff line numberDiff line change
@@ -17,19 +17,11 @@ import (
1717
"github.com/getsops/sops/v3/gcpkms"
1818
"github.com/getsops/sops/v3/hcvault"
1919
"github.com/getsops/sops/v3/kms"
20-
"github.com/getsops/sops/v3/logging"
2120
"github.com/getsops/sops/v3/pgp"
2221
"github.com/getsops/sops/v3/publish"
23-
"github.com/sirupsen/logrus"
2422
"gopkg.in/yaml.v3"
2523
)
2624

27-
var log *logrus.Logger
28-
29-
func init() {
30-
log = logging.NewLogger("CONFIG")
31-
}
32-
3325
type fileSystem interface {
3426
Stat(name string) (os.FileInfo, error)
3527
}
@@ -377,19 +369,17 @@ func parseDestinationRuleForFile(conf *configFile, filePath string, kmsEncryptio
377369
}
378370

379371
var dest publish.Destination
380-
if dRule != nil {
381-
if dRule.S3Bucket != "" && dRule.GCSBucket != "" && dRule.VaultPath != "" {
382-
return nil, fmt.Errorf("error loading config: more than one destinations were found in a single destination rule, you can only use one per rule")
383-
}
384-
if dRule.S3Bucket != "" {
385-
dest = publish.NewS3Destination(dRule.S3Bucket, dRule.S3Prefix)
386-
}
387-
if dRule.GCSBucket != "" {
388-
dest = publish.NewGCSDestination(dRule.GCSBucket, dRule.GCSPrefix)
389-
}
390-
if dRule.VaultPath != "" {
391-
dest = publish.NewVaultDestination(dRule.VaultAddress, dRule.VaultPath, dRule.VaultKVMountName, dRule.VaultKVVersion)
392-
}
372+
if dRule.S3Bucket != "" && dRule.GCSBucket != "" && dRule.VaultPath != "" {
373+
return nil, fmt.Errorf("error loading config: more than one destinations were found in a single destination rule, you can only use one per rule")
374+
}
375+
if dRule.S3Bucket != "" {
376+
dest = publish.NewS3Destination(dRule.S3Bucket, dRule.S3Prefix)
377+
}
378+
if dRule.GCSBucket != "" {
379+
dest = publish.NewGCSDestination(dRule.GCSBucket, dRule.GCSPrefix)
380+
}
381+
if dRule.VaultPath != "" {
382+
dest = publish.NewVaultDestination(dRule.VaultAddress, dRule.VaultPath, dRule.VaultKVMountName, dRule.VaultKVVersion)
393383
}
394384

395385
config, err := configFromRule(rule, kmsEncryptionContext)

0 commit comments

Comments
 (0)