Skip to content

Commit

Permalink
Merge pull request #1285 from cuishuang/main
Browse files Browse the repository at this point in the history
fix: fix slice init length
  • Loading branch information
stgraber authored Oct 4, 2024
2 parents f72f1df + d9fdfc5 commit f7c0f55
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion internal/server/network/ovn/ovn_icsb_actions.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ func (o *ICSB) GetGateways(ctx context.Context, name string) ([]string, error) {
}

// Extract the names.
names := make([]string, len(gateways))
names := make([]string, 0, len(gateways))
for _, entry := range gateways {
names = append(names, entry.Name)
}
Expand Down
2 changes: 1 addition & 1 deletion internal/server/storage/drivers/driver_ceph_volumes.go
Original file line number Diff line number Diff line change
Expand Up @@ -1173,7 +1173,7 @@ func (d *ceph) ListVolumes() ([]Volume, error) {
return nil, fmt.Errorf("Failed getting volume list: %v: %w", strings.TrimSpace(string(errMsg)), err)
}

volList := make([]Volume, len(vols))
volList := make([]Volume, 0, len(vols))
for _, v := range vols {
volList = append(volList, v)
}
Expand Down
2 changes: 1 addition & 1 deletion internal/server/storage/drivers/driver_lvm_volumes.go
Original file line number Diff line number Diff line change
Expand Up @@ -684,7 +684,7 @@ func (d *lvm) ListVolumes() ([]Volume, error) {
return nil, fmt.Errorf("Failed getting volume list: %v: %w", strings.TrimSpace(string(errMsg)), err)
}

volList := make([]Volume, len(vols))
volList := make([]Volume, 0, len(vols))
for _, v := range vols {
volList = append(volList, v)
}
Expand Down
2 changes: 1 addition & 1 deletion internal/server/storage/drivers/driver_zfs_volumes.go
Original file line number Diff line number Diff line change
Expand Up @@ -2043,7 +2043,7 @@ func (d *zfs) ListVolumes() ([]Volume, error) {
return nil, fmt.Errorf("Failed getting volume list: %v: %w", strings.TrimSpace(string(errMsg)), err)
}

volList := make([]Volume, len(vols))
volList := make([]Volume, 0, len(vols))
for _, v := range vols {
volList = append(volList, v)
}
Expand Down

0 comments on commit f7c0f55

Please sign in to comment.