Modify return to follow Golang conventions
This commit is contained in:
parent
9781e160a4
commit
36e528e365
1 changed files with 5 additions and 9 deletions
|
@ -22,17 +22,13 @@ func NewSecretReplacer(secrets []*model.Secret) SecretReplacer {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var replacer SecretReplacer
|
if len(r) == 0 {
|
||||||
|
return &noopReplacer{}
|
||||||
|
}
|
||||||
|
|
||||||
if len(r) > 0 {
|
return &secretReplacer{
|
||||||
replacer = &secretReplacer{
|
|
||||||
replacer: strings.NewReplacer(r...),
|
replacer: strings.NewReplacer(r...),
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
replacer = &noopReplacer{}
|
|
||||||
}
|
|
||||||
|
|
||||||
return replacer
|
|
||||||
}
|
}
|
||||||
|
|
||||||
type noopReplacer struct{}
|
type noopReplacer struct{}
|
||||||
|
|
Loading…
Reference in a new issue