Skip to content

Commit

Permalink
fix: parse partition size correctly
Browse files Browse the repository at this point in the history
`strconv.ParseInt` always returns error for bitSize -1.

Found by the latest golangci-lint.

Signed-off-by: Alexey Palazhchenko <alexey.palazhchenko@talos-systems.com>
  • Loading branch information
AlekSi committed Nov 11, 2021
1 parent d6147eb commit 7efc123
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cmd/talosctl/cmd/mgmt/cluster/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -737,7 +737,7 @@ func getDisks() ([]*provision.Disk, error) {
return nil, fmt.Errorf("user disk partitions can only be mounted into /var folder")
}

value, e := strconv.ParseInt(partitions[j+1], 10, -1)
value, e := strconv.ParseInt(partitions[j+1], 10, 0)
partitionSize := uint64(value)

if e != nil {
Expand Down

0 comments on commit 7efc123

Please sign in to comment.