1
0
Fork 0
mirror of https://github.com/restic/restic.git synced 2025-03-16 00:00:05 +01:00

fix lint - unused param prefix now used for smb

This commit is contained in:
Aneesh Nireshwalia 2023-07-10 15:23:00 -06:00
parent bc3331082c
commit 53a62d452c

View file

@ -128,13 +128,13 @@ func createConfig(user string, host string, port int, sharename, directory strin
// ApplyEnvironment saves values from the environment to the config.
func (cfg *Config) ApplyEnvironment(prefix string) error {
if cfg.User == "" {
cfg.User = os.Getenv("RESTIC_SMB_USER")
cfg.User = os.Getenv(prefix + "RESTIC_SMB_USER")
}
if cfg.Password.String() == "" {
cfg.Password = options.NewSecretString(os.Getenv("RESTIC_SMB_PASSWORD"))
cfg.Password = options.NewSecretString(os.Getenv(prefix + "RESTIC_SMB_PASSWORD"))
}
if cfg.Domain == "" {
cfg.Domain = os.Getenv("RESTIC_SMB_DOMAIN")
cfg.Domain = os.Getenv(prefix + "RESTIC_SMB_DOMAIN")
}
if cfg.Domain == "" {
cfg.Domain = DefaultDomain