Skip to content

Commit 99cef6f

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

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

opts/gpus.go

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

106106
// String returns a string repr of this option
107107
func (o *GpuOpts) String() string {
108-
gpus := []string{}
108+
gpus := make([]string, 0, len(o.values))
109109
for _, gpu := range o.values {
110110
gpus = append(gpus, fmt.Sprintf("%v", gpu))
111111
}

opts/mount.go

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

152152
// String returns a string repr of this option
153153
func (m *MountOpt) String() string {
154-
mounts := []string{}
154+
mounts := make([]string, 0, len(m.values))
155155
for _, mount := range m.values {
156156
repr := fmt.Sprintf("%s %s %s", mount.Type, mount.Source, mount.Target)
157157
mounts = append(mounts, repr)

0 commit comments

Comments
 (0)