Skip to content

Commit 8a8a3e1

Browse files
committed
opts/swarmopts: fix prealloc linting
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
1 parent 9d2816c commit 8a8a3e1

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

opts/swarmopts/config.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ func (*ConfigOpt) Type() string {
8686

8787
// String returns a string repr of this option
8888
func (o *ConfigOpt) String() string {
89-
configs := []string{}
89+
configs := make([]string, 0, len(o.values))
9090
for _, config := range o.values {
9191
repr := fmt.Sprintf("%s -> %s", config.ConfigName, config.File.Name)
9292
configs = append(configs, repr)

opts/swarmopts/secret.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ func (*SecretOpt) Type() string {
8585

8686
// String returns a string repr of this option
8787
func (o *SecretOpt) String() string {
88-
secrets := []string{}
88+
secrets := make([]string, 0, len(o.values))
8989
for _, secret := range o.values {
9090
repr := fmt.Sprintf("%s -> %s", secret.SecretName, secret.File.Name)
9191
secrets = append(secrets, repr)

0 commit comments

Comments
 (0)