Skip to content

Commit

Permalink
feat: Build with go 1.23 (#889)
Browse files Browse the repository at this point in the history
  • Loading branch information
jimmidyson authored Aug 27, 2024
1 parent e2e4a68 commit 2910d17
Show file tree
Hide file tree
Showing 12 changed files with 389 additions and 437 deletions.
2 changes: 1 addition & 1 deletion .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -154,4 +154,4 @@ checksum:
name_template: 'checksums.txt'

snapshot:
name_template: "{{ incminor .Tag }}-dev"
version_template: "{{ incminor .Tag }}-dev"
2 changes: 1 addition & 1 deletion api/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ module github.com/nutanix-cloud-native/cluster-api-runtime-extensions-nutanix/ap

go 1.22.0

toolchain go1.22.5
toolchain go1.23.0

replace github.com/nutanix-cloud-native/cluster-api-runtime-extensions-nutanix/common => ../common

Expand Down
10 changes: 5 additions & 5 deletions api/v1alpha1/nutanix_clusterconfig_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,11 @@ type NutanixPrismCentralEndpointCredentials struct {
}

//nolint:gocritic // No need for named return values
func (s NutanixPrismCentralEndpointSpec) ParseURL() (string, int32, error) {
func (s NutanixPrismCentralEndpointSpec) ParseURL() (string, uint16, error) {
var prismCentralURL *url.URL
prismCentralURL, err := url.Parse(s.URL)
if err != nil {
return "", -1, fmt.Errorf("error parsing Prism Central URL: %w", err)
return "", 0, fmt.Errorf("error parsing Prism Central URL: %w", err)
}

hostname := prismCentralURL.Hostname()
Expand All @@ -69,10 +69,10 @@ func (s NutanixPrismCentralEndpointSpec) ParseURL() (string, int32, error) {
return hostname, DefaultPrismCentralPort, nil
}

port, err := strconv.ParseInt(prismCentralURL.Port(), 10, 32)
port, err := strconv.ParseUint(prismCentralURL.Port(), 10, 16)
if err != nil {
return "", -1, fmt.Errorf("error converting port to int: %w", err)
return "", 0, fmt.Errorf("error converting port to int: %w", err)
}

return hostname, int32(port), nil
return hostname, uint16(port), nil //nolint:gosec // Bounds are checked by ParseUint call above.
}
2 changes: 1 addition & 1 deletion common/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ module github.com/nutanix-cloud-native/cluster-api-runtime-extensions-nutanix/co

go 1.22.0

toolchain go1.22.5
toolchain go1.23.0

replace github.com/nutanix-cloud-native/cluster-api-runtime-extensions-nutanix/api => ../api

Expand Down
2 changes: 1 addition & 1 deletion devbox.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
"golines@latest",
"goreleaser@latest",
"gotestsum@latest",
"govulncheck@latest",
"helm-docs@latest",
"hugo@latest",
"kind@latest",
Expand All @@ -36,6 +35,7 @@
"path:./hack/flakes#go-mod-upgrade",
"path:./hack/flakes#golangci-lint",
"path:./hack/flakes#goprintconst",
"path:./hack/flakes#govulncheck",
"path:./hack/flakes#helm-with-plugins",
"path:./hack/flakes#release-please",
"path:./hack/flakes#setup-envtest"
Expand Down
Loading

0 comments on commit 2910d17

Please sign in to comment.