Skip to content

Commit

Permalink
bump minimum go version to 1.19 (#253)
Browse files Browse the repository at this point in the history
---------

Signed-off-by: Alex Boten <aboten@lightstep.com>
  • Loading branch information
Alex Boten authored Feb 18, 2023
1 parent 819bcba commit a637b70
Show file tree
Hide file tree
Showing 33 changed files with 68 additions and 52 deletions.
16 changes: 16 additions & 0 deletions .chloggen/codeboten_bump-minimum.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
change_type: breaking

# The name of the component, or a single word describing the area of concern, (e.g. crosslink)
component: all

# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
note: bump minimum go version to 1.19

# One or more tracking issues related to the change
issues: [253]

# (Optional) One or more lines of additional information to render under the primary note.
# These lines will be padded with 2 spaces and then inserted directly into the document.
# Use pipe (|) for multiline entries.
subtext:
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ env:
# Path to where test results will be saved.
TEST_RESULTS: /tmp/test-results
# Default minimum version of Go to support.
DEFAULT_GO_VERSION: 1.18
DEFAULT_GO_VERSION: 1.19
jobs:
lint:
runs-on: ubuntu-latest
Expand Down
2 changes: 1 addition & 1 deletion checkdoc/go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module go.opentelemetry.io/build-tools/checkdoc

go 1.18
go 1.19

require github.com/stretchr/testify v1.8.1

Expand Down
2 changes: 1 addition & 1 deletion chloggen/go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module go.opentelemetry.io/build-tools/chloggen

go 1.18
go 1.19

require (
github.com/spf13/cobra v1.6.1
Expand Down
2 changes: 1 addition & 1 deletion crosslink/go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module go.opentelemetry.io/build-tools/crosslink

go 1.18
go 1.19

require (
github.com/google/go-cmp v0.5.9
Expand Down
36 changes: 18 additions & 18 deletions crosslink/internal/crosslink_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ func TestCrosslink(t *testing.T) {
config: DefaultRunConfig(),
expected: map[string][]byte{
"go.mod": []byte("module go.opentelemetry.io/build-tools/crosslink/testroot\n\n" +
"go 1.18\n\n" +
"go 1.19\n\n" +
"require (\n\t" +
"go.opentelemetry.io/build-tools/crosslink/testroot/testA v1.0.0\n" +
")\n" +
Expand All @@ -52,13 +52,13 @@ func TestCrosslink(t *testing.T) {
"replace go.opentelemetry.io/build-tools/crosslink/testroot/testZ => ./testZ\n\n" +
"replace go.opentelemetry.io/build-tools/crosslink/testroot/testB => ./testB"),
filepath.Join("testA", "go.mod"): []byte("module go.opentelemetry.io/build-tools/crosslink/testroot/testA\n\n" +
"go 1.18\n\n" +
"go 1.19\n\n" +
"require (\n\t" +
"go.opentelemetry.io/build-tools/crosslink/testroot/testB v1.0.0\n" +
")\n" +
"replace go.opentelemetry.io/build-tools/crosslink/testroot/testB => ../testB"),
filepath.Join("testB", "go.mod"): []byte("module go.opentelemetry.io/build-tools/crosslink/testroot/testB\n\n" +
"go 1.18\n\n"),
"go 1.19\n\n"),
},
},
{
Expand All @@ -67,22 +67,22 @@ func TestCrosslink(t *testing.T) {
config: DefaultRunConfig(),
expected: map[string][]byte{
"go.mod": []byte("module go.opentelemetry.io/build-tools/crosslink/testroot\n\n" +
"go 1.18\n\n" +
"go 1.19\n\n" +
"require (\n\t" +
"go.opentelemetry.io/build-tools/crosslink/testroot/testA v1.0.0\n" +
")\n" +
"replace go.opentelemetry.io/build-tools/crosslink/testroot/testA => ./testA\n\n" +
"replace go.opentelemetry.io/build-tools/crosslink/testroot/testB => ./testB"),
filepath.Join("testA", "go.mod"): []byte("module go.opentelemetry.io/build-tools/crosslink/testroot/testA\n\n" +
"go 1.18\n\n" +
"go 1.19\n\n" +
"require (\n\t" +
"go.opentelemetry.io/build-tools/crosslink/testroot/testB v1.0.0\n" +
")\n" +
"replace go.opentelemetry.io/build-tools/crosslink/testroot/testB => ../testB\n\n" +
"replace go.opentelemetry.io/build-tools/crosslink/testroot => ../"),
// b has req on root but not necessary to write out with current comparison logic
filepath.Join("testB", "go.mod"): []byte("module go.opentelemetry.io/build-tools/crosslink/testroot/testB\n\n" +
"go 1.18\n\n" +
"go 1.19\n\n" +
"replace go.opentelemetry.io/build-tools/crosslink/testroot/testA => ../testA\n\n" +
"replace go.opentelemetry.io/build-tools/crosslink/testroot => ../\n\n"),
},
Expand All @@ -96,20 +96,20 @@ func TestCrosslink(t *testing.T) {
},
expected: map[string][]byte{
"go.mod": []byte("module go.opentelemetry.io/build-tools/crosslink/testroot\n\n" +
"go 1.18\n\n" +
"go 1.19\n\n" +
"require (\n\t" +
"go.opentelemetry.io/build-tools/crosslink/testroot/testA v1.0.0\n" +
")\n" +
"replace go.opentelemetry.io/build-tools/crosslink/testroot/testA => ./testA\n\n" +
"replace go.opentelemetry.io/build-tools/crosslink/testroot/testB => ./testB"),
filepath.Join("testA", "go.mod"): []byte("module go.opentelemetry.io/build-tools/crosslink/testroot/testA\n\n" +
"go 1.18\n\n" +
"go 1.19\n\n" +
"require (\n\t" +
"go.opentelemetry.io/build-tools/crosslink/testroot/testB v1.0.0\n" +
")\n" +
"replace go.opentelemetry.io/build-tools/crosslink/testroot/testB => ../testB"),
filepath.Join("testB", "go.mod"): []byte("module go.opentelemetry.io/build-tools/crosslink/testroot/testB\n\n" +
"go 1.18\n\n"),
"go 1.19\n\n"),
},
},
}
Expand Down Expand Up @@ -188,20 +188,20 @@ func TestOverwrite(t *testing.T) {
},
expected: map[string][]byte{
"go.mod": []byte("module go.opentelemetry.io/build-tools/crosslink/testroot\n\n" +
"go 1.18\n\n" +
"go 1.19\n\n" +
"require (\n\t" +
"go.opentelemetry.io/build-tools/crosslink/testroot/testA v1.0.0\n" +
")\n" +
"replace go.opentelemetry.io/build-tools/crosslink/testroot/testA => ./testA\n\n" +
"replace go.opentelemetry.io/build-tools/crosslink/testroot/testB => ./testB"),
filepath.Join("testA", "go.mod"): []byte("module go.opentelemetry.io/build-tools/crosslink/testroot/testA\n\n" +
"go 1.18\n\n" +
"go 1.19\n\n" +
"require (\n\t" +
"go.opentelemetry.io/build-tools/crosslink/testroot/testB v1.0.0\n" +
")\n" +
"replace go.opentelemetry.io/build-tools/crosslink/testroot/testB => ../testB"),
filepath.Join("testB", "go.mod"): []byte("module go.opentelemetry.io/build-tools/crosslink/testroot/testB\n\n" +
"go 1.18\n\n"),
"go 1.19\n\n"),
},
},
{
Expand All @@ -213,20 +213,20 @@ func TestOverwrite(t *testing.T) {
},
expected: map[string][]byte{
"go.mod": []byte("module go.opentelemetry.io/build-tools/crosslink/testroot\n\n" +
"go 1.18\n\n" +
"go 1.19\n\n" +
"require (\n\t" +
"go.opentelemetry.io/build-tools/crosslink/testroot/testA v1.0.0\n" +
")\n" +
"replace go.opentelemetry.io/build-tools/crosslink/testroot/testA => ../testA\n\n" +
"replace go.opentelemetry.io/build-tools/crosslink/testroot/testB => ./testB"),
filepath.Join("testA", "go.mod"): []byte("module go.opentelemetry.io/build-tools/crosslink/testroot/testA\n\n" +
"go 1.18\n\n" +
"go 1.19\n\n" +
"require (\n\t" +
"go.opentelemetry.io/build-tools/crosslink/testroot/testB v1.0.0\n" +
")\n" +
"replace go.opentelemetry.io/build-tools/crosslink/testroot/testB => ../testB"),
filepath.Join("testB", "go.mod"): []byte("module go.opentelemetry.io/build-tools/crosslink/testroot/testB\n\n" +
"go 1.18\n\n"),
"go 1.19\n\n"),
},
},
}
Expand Down Expand Up @@ -352,20 +352,20 @@ func TestExclude(t *testing.T) {
// a mock_test_data_expected folder could be built instead of building expected files by hand.
modFilesExpected := map[string][]byte{
filepath.Join(tmpRootDir, "go.mod"): []byte("module go.opentelemetry.io/build-tools/crosslink/testroot\n\n" +
"go 1.18\n\n" +
"go 1.19\n\n" +
"require (\n\t" +
"go.opentelemetry.io/build-tools/crosslink/testroot/testA v1.0.0\n" +
")\n" +
"replace go.opentelemetry.io/build-tools/crosslink/testroot/testA => ../testA\n\n" +
"replace go.opentelemetry.io/build-tools/excludeme => ../excludeme\n\n"),
filepath.Join(tmpRootDir, "testA", "go.mod"): []byte("module go.opentelemetry.io/build-tools/crosslink/testroot/testA\n\n" +
"go 1.18\n\n" +
"go 1.19\n\n" +
"require (\n\t" +
"go.opentelemetry.io/build-tools/crosslink/testroot/testB v1.0.0\n" +
")\n" +
"replace go.opentelemetry.io/build-tools/crosslink/testroot/testB => ../testB"),
filepath.Join(tmpRootDir, "testB", "go.mod"): []byte("module go.opentelemetry.io/build-tools/crosslink/testroot/testB\n\n" +
"go 1.18\n\n"),
"go 1.19\n\n"),
}

for modFilePath, modFilesExpected := range modFilesExpected {
Expand Down
2 changes: 1 addition & 1 deletion crosslink/internal/mock_test_data/testCyclic/gomod
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module go.opentelemetry.io/build-tools/crosslink/testroot

go 1.18
go 1.19

require go.opentelemetry.io/build-tools/crosslink/testroot/testA v1.0.0
2 changes: 1 addition & 1 deletion crosslink/internal/mock_test_data/testCyclic/testA/gomod
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module go.opentelemetry.io/build-tools/crosslink/testroot/testA

go 1.18
go 1.19

require go.opentelemetry.io/build-tools/crosslink/testroot/testB v1.0.0
2 changes: 1 addition & 1 deletion crosslink/internal/mock_test_data/testCyclic/testB/gomod
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module go.opentelemetry.io/build-tools/crosslink/testroot/testB

go 1.18
go 1.19

require go.opentelemetry.io/build-tools/crosslink/testroot v1.0.0
2 changes: 1 addition & 1 deletion crosslink/internal/mock_test_data/testExclude/gomod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module go.opentelemetry.io/build-tools/crosslink/testroot

go 1.18
go 1.19

require go.opentelemetry.io/build-tools/crosslink/testroot/testA v1.0.0

Expand Down
2 changes: 1 addition & 1 deletion crosslink/internal/mock_test_data/testExclude/testA/gomod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module go.opentelemetry.io/build-tools/crosslink/testroot/testA

go 1.18
go 1.19

require go.opentelemetry.io/build-tools/crosslink/testroot/testB v1.0.0

Expand Down
2 changes: 1 addition & 1 deletion crosslink/internal/mock_test_data/testExclude/testB/gomod
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module go.opentelemetry.io/build-tools/crosslink/testroot/testB

go 1.18
go 1.19
2 changes: 1 addition & 1 deletion crosslink/internal/mock_test_data/testNoOverwrite/gomod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module go.opentelemetry.io/build-tools/crosslink/testroot

go 1.18
go 1.19

require go.opentelemetry.io/build-tools/crosslink/testroot/testA v1.0.0

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module go.opentelemetry.io/build-tools/crosslink/testroot/testA

go 1.18
go 1.19

require go.opentelemetry.io/build-tools/crosslink/testroot/testB v1.0.0
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module go.opentelemetry.io/build-tools/crosslink/testroot/testB

go 1.18
go 1.19
2 changes: 1 addition & 1 deletion crosslink/internal/mock_test_data/testOverwrite/gomod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module go.opentelemetry.io/build-tools/crosslink/testroot

go 1.18
go 1.19

require go.opentelemetry.io/build-tools/crosslink/testroot/testA v1.0.0

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module go.opentelemetry.io/build-tools/crosslink/testroot/testA

go 1.18
go 1.19

require go.opentelemetry.io/build-tools/crosslink/testroot/testB v1.0.0
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module go.opentelemetry.io/build-tools/crosslink/testroot/testB

go 1.18
go 1.19
2 changes: 1 addition & 1 deletion crosslink/internal/mock_test_data/testPrune/gomod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module go.opentelemetry.io/build-tools/crosslink/testroot

go 1.18
go 1.19

require (
go.opentelemetry.io/build-tools/crosslink/testroot/testA v1.0.0
Expand Down
2 changes: 1 addition & 1 deletion crosslink/internal/mock_test_data/testSimple/gomod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module go.opentelemetry.io/build-tools/crosslink/testroot

go 1.18
go 1.19

require go.opentelemetry.io/build-tools/crosslink/testroot/testA v1.0.0

Expand Down
2 changes: 1 addition & 1 deletion crosslink/internal/mock_test_data/testSimple/testA/gomod
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module go.opentelemetry.io/build-tools/crosslink/testroot/testA

go 1.18
go 1.19

require go.opentelemetry.io/build-tools/crosslink/testroot/testB v1.0.0
2 changes: 1 addition & 1 deletion crosslink/internal/mock_test_data/testSimple/testB/gomod
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module go.opentelemetry.io/build-tools/crosslink/testroot/testB

go 1.18
go 1.19
2 changes: 1 addition & 1 deletion crosslink/internal/mock_test_data/testSimplePrune/gomod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module go.opentelemetry.io/build-tools/crosslink/testroot

go 1.18
go 1.19

require go.opentelemetry.io/build-tools/crosslink/testroot/testA v1.0.0

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module go.opentelemetry.io/build-tools/crosslink/testroot/testA

go 1.18
go 1.19

require go.opentelemetry.io/build-tools/crosslink/testroot/testB v1.0.0

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module go.opentelemetry.io/build-tools/crosslink/testroot/testB

go 1.18
go 1.19
8 changes: 4 additions & 4 deletions crosslink/internal/prune_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,20 +46,20 @@ func TestPrune(t *testing.T) {
},
expected: map[string][]byte{
"go.mod": []byte("module go.opentelemetry.io/build-tools/crosslink/testroot\n\n" +
"go 1.18\n\n" +
"go 1.19\n\n" +
"require (\n\t" +
"go.opentelemetry.io/build-tools/crosslink/testroot/testA v1.0.0\n" +
")\n" +
"replace go.opentelemetry.io/build-tools/crosslink/testroot/testA => ./testA\n\n" +
"replace go.opentelemetry.io/build-tools/crosslink/testroot/testB => ./testB"),
filepath.Join("testA", "go.mod"): []byte("module go.opentelemetry.io/build-tools/crosslink/testroot/testA\n\n" +
"go 1.18\n\n" +
"go 1.19\n\n" +
"require (\n\t" +
"go.opentelemetry.io/build-tools/crosslink/testroot/testB v1.0.0\n" +
")\n" +
"replace go.opentelemetry.io/build-tools/crosslink/testroot/testB => ../testB"),
filepath.Join("testB", "go.mod"): []byte("module go.opentelemetry.io/build-tools/crosslink/testroot/testB\n\n" +
"go 1.18\n\n"),
"go 1.19\n\n"),
},
},
}
Expand Down Expand Up @@ -162,7 +162,7 @@ func TestPruneReplace(t *testing.T) {
pruneReplace("go.opentelemetry.io/build-tools/crosslink/testroot", mockModInfo, RunConfig{Prune: true, Verbose: true, Logger: lg})

expectedModFile := []byte("module go.opentelemetry.io/build-tools/crosslink/testroot\n\n" +
"go 1.18\n\n" +
"go 1.19\n\n" +
"require (\n\t" +
"go.opentelemetry.io/build-tools/crosslink/testroot/testA v1.0.0\n" +
"go.opentelemetry.io/build-tools/crosslink/testroot/testB v1.0.0\n" +
Expand Down
2 changes: 1 addition & 1 deletion dbotconf/go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module go.opentelemetry.io/build-tools/dbotconf

go 1.18
go 1.19

require (
github.com/spf13/cobra v1.6.1
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module go.opentelemetry.io/build-tools

go 1.18
go 1.19

require (
github.com/stretchr/testify v1.8.1
Expand Down
2 changes: 1 addition & 1 deletion internal/repo/repo_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ func TestFindDockerfiles(t *testing.T) {
dFile := filepath.Join(path.dir, path.file)
f, err := os.Create(filepath.Clean(dFile))
require.NoError(t, err)
fmt.Fprint(f, "FROM golang:1.18-alpine\n")
fmt.Fprint(f, "FROM golang:1.19-alpine\n")
require.NoError(t, f.Close())
}
// Add an empty dir.
Expand Down
Loading

0 comments on commit a637b70

Please sign in to comment.