Skip to content

Commit aad755c

Browse files
authored
Merge pull request #2364 from AidanDelaney/feat/bump-go-1.24
Bump to go 1.24
2 parents a1edf2e + 9100de5 commit aad755c

16 files changed

Lines changed: 547 additions & 482 deletions

File tree

Makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -160,12 +160,12 @@ install-goimports:
160160
## install-golangci-lint: Install golangci-lint dependency
161161
install-golangci-lint:
162162
@echo "=====> Installing golangci-lint..."
163-
cd tools && $(GOCMD) install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.61.0
163+
cd tools && $(GOCMD) install github.com/golangci/golangci-lint/v2/cmd/golangci-lint@v2.0.2
164164

165165
## mod-tidy: Tidy Go modules
166166
mod-tidy:
167-
$(GOCMD) mod tidy -compat=1.23
168-
cd tools && $(GOCMD) mod tidy -compat=1.23
167+
$(GOCMD) mod tidy -compat=1.24
168+
cd tools && $(GOCMD) mod tidy -compat=1.24
169169

170170
## tidy: Tidy modules and format the code
171171
tidy: mod-tidy format

builder/config_reader.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ type ModuleConfig struct {
3838
}
3939

4040
func (c *ModuleConfig) DisplayString() string {
41-
if c.ModuleInfo.FullName() != "" {
42-
return c.ModuleInfo.FullName()
41+
if c.FullName() != "" {
42+
return c.FullName()
4343
}
4444

4545
return c.ImageOrURI.DisplayString()

go.mod

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,6 @@ require (
146146

147147
replace github.com/BurntSushi/toml => github.com/BurntSushi/toml v1.3.2
148148

149-
go 1.23.0
149+
go 1.24.0
150150

151-
toolchain go1.23.3
151+
toolchain go1.24.2

golangci.yaml

Lines changed: 36 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,51 @@
1-
run:
2-
timeout: 6m
3-
1+
version: "2"
42
linters:
5-
disable-all: true
3+
default: none
64
enable:
75
- bodyclose
8-
- exportloopref
96
- dogsled
107
- gocritic
11-
- goimports
12-
- gosimple
138
- govet
149
- ineffassign
1510
- misspell
1611
- nakedret
1712
- revive
1813
- rowserrcheck
1914
- staticcheck
20-
- stylecheck
21-
- typecheck
2215
- unconvert
2316
- unused
2417
- whitespace
25-
26-
linters-settings:
27-
goimports:
28-
local-prefixes: github.com/buildpacks/pack
29-
revive:
30-
rules:
31-
- name: error-strings
32-
disabled: true
18+
settings:
19+
revive:
20+
rules:
21+
- name: error-strings
22+
disabled: true
23+
exclusions:
24+
generated: lax
25+
presets:
26+
- comments
27+
- common-false-positives
28+
- legacy
29+
- std-error-handling
30+
paths:
31+
- third_party$
32+
- builtin$
33+
- examples$
34+
formatters:
35+
enable:
36+
- goimports
37+
settings:
38+
goimports:
39+
local-prefixes:
40+
- github.com/buildpacks/pack
41+
exclusions:
42+
generated: lax
43+
paths:
44+
- third_party$
45+
- builtin$
46+
- examples$
47+
issues:
48+
default: info
49+
rules:
50+
- linters:
51+
- staticcheck: info

internal/builder/version.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ func (v *Version) Equal(other *Version) bool {
3131

3232
// MarshalText makes Version satisfy the encoding.TextMarshaler interface.
3333
func (v *Version) MarshalText() ([]byte, error) {
34-
return []byte(v.Version.Original()), nil
34+
return []byte(v.Original()), nil
3535
}
3636

3737
// UnmarshalText makes Version satisfy the encoding.TextUnmarshaler interface.

pkg/archive/archive.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -369,11 +369,11 @@ func NormalizeHeader(header *tar.Header, normalizeModTime bool) {
369369
func IsZip(path string) (bool, error) {
370370
r, err := zip.OpenReader(path)
371371

372-
switch {
373-
case err == nil:
372+
switch err {
373+
case nil:
374374
r.Close()
375375
return true, nil
376-
case err == zip.ErrFormat:
376+
case zip.ErrFormat:
377377
return false, nil
378378
default:
379379
return false, err

pkg/buildpack/builder.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -509,7 +509,7 @@ func validateBuildpacks(mainBP BuildModule, depBPs []BuildModule) error {
509509
bpd := bp.Descriptor()
510510
for _, orderEntry := range bpd.Order() {
511511
for _, groupEntry := range orderEntry.Group {
512-
bpFullName, err := groupEntry.ModuleInfo.FullNameWithVersion()
512+
bpFullName, err := groupEntry.FullNameWithVersion()
513513
if err != nil {
514514
return errors.Wrapf(
515515
err,

pkg/client/build.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,7 @@ type layoutPathConfig struct {
297297
func (c *Client) Build(ctx context.Context, opts BuildOptions) error {
298298
var pathsConfig layoutPathConfig
299299

300-
if RunningInContainer() && !(opts.PullPolicy == image.PullAlways) {
300+
if RunningInContainer() && (opts.PullPolicy != image.PullAlways) {
301301
c.logger.Warnf("Detected pack is running in a container; if using a shared docker host, failing to pull build inputs from a remote registry is insecure - " +
302302
"other tenants may have compromised build inputs stored in the daemon." +
303303
"This configuration is insecure and may become unsupported in the future." +
@@ -569,7 +569,7 @@ func (c *Client) Build(ctx context.Context, opts BuildOptions) error {
569569
if targetToUse.OS == "windows" {
570570
return fmt.Errorf("builder contains image extensions which are not supported for Windows builds")
571571
}
572-
if !(opts.PullPolicy == image.PullAlways) {
572+
if opts.PullPolicy != image.PullAlways {
573573
return fmt.Errorf("pull policy must be 'always' when builder contains image extensions")
574574
}
575575
}

pkg/client/register_buildpack.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,8 @@ func (c *Client) RegisterBuildpack(ctx context.Context, opts RegisterBuildpackOp
5353
Yanked: false,
5454
}
5555

56-
if opts.Type == "github" {
56+
switch opts.Type {
57+
case "github":
5758
issueURL, err := registry.GetIssueURL(opts.URL)
5859
if err != nil {
5960
return err
@@ -76,7 +77,7 @@ func (c *Client) RegisterBuildpack(ctx context.Context, opts RegisterBuildpackOp
7677
}
7778

7879
return cmd.Start()
79-
} else if opts.Type == "git" {
80+
case "git":
8081
registryCache, err := getRegistry(c.logger, opts.Name)
8182
if err != nil {
8283
return err

pkg/dist/dist.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,11 @@ type ImageOrURI struct {
2727
}
2828

2929
func (c *ImageOrURI) DisplayString() string {
30-
if c.BuildpackURI.URI != "" {
31-
return c.BuildpackURI.URI
30+
if c.URI != "" {
31+
return c.URI
3232
}
3333

34-
return c.ImageRef.ImageName
34+
return c.ImageName
3535
}
3636

3737
type Platform struct {

0 commit comments

Comments
 (0)