1
0
mirror of https://github.com/docker/cli.git synced 2026-11-01 23:35:23 +03:00

opts/swarmopts: fix prealloc linting

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
Sebastiaan van Stijn
2026-02-11 11:26:08 +01:00
parent 9d2816c8a5
commit 8a8a3e1309
2 changed files with 2 additions and 2 deletions

View File

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

View File

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