Skip to content

Commit

Permalink
fix: fix slice init length (#4412)
Browse files Browse the repository at this point in the history
Co-authored-by: CoderZhi <[email protected]>
Co-authored-by: Chen Chen <[email protected]>
  • Loading branch information
3 people authored Oct 23, 2024
1 parent 112815d commit 5e2cd1d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion ioctl/cmd/ws/wsdeviceapprove.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ func approveProjectDevice(projectID uint64, devices string) (string, error) {
deviceArr = strings.Split(devices, ",")
}

deviceAddress := make([]common.Address, len(deviceArr))
deviceAddress := make([]common.Address, 0, len(deviceArr))
for _, device := range deviceArr {
addr, err := address.FromString(device)
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion ioctl/cmd/ws/wsdeviceunapprove.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ func unapproveProjectDevice(projectID uint64, devices string) (string, error) {
deviceArr = strings.Split(devices, ",")
}

deviceAddress := make([]common.Address, len(deviceArr))
deviceAddress := make([]common.Address, 0, len(deviceArr))
for _, device := range deviceArr {
addr, err := address.FromString(device)
if err != nil {
Expand Down

0 comments on commit 5e2cd1d

Please sign in to comment.