Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade to Go 1.22, 1.23 #1235

Merged
merged 1 commit into from
Aug 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
strategy:
matrix:
os: ["ubuntu-latest", "windows-latest"]
go: ["1.21.x", "1.22.x"]
go: ["1.22.x", "1.23.x"]
Copy link

@rabbbit rabbbit Aug 27, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

    strategy:
      matrix:
        go: ["stable", "oldstable"]

and then

 go-version: ${{ matrix.go }}
if: matrix.latest

below? Or do we want to control this individually?

(https://github.com/uber-go/ratelimit/blob/main/.github/workflows/test.yaml)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm... I don't have a big preference. Sometimes the latest version breaks some tests, and sometimes upgrading involves removing some old build-tagged tests (e.g., this PR). So in that vein it makes sense to make upgrading an explicit action/PR. On the other hand, this would reduce manual ops work.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

stable oldstable is also a valid option here. I'll defer to you on whether you want that or not.


steps:
- name: Checkout code
Expand Down Expand Up @@ -52,7 +52,7 @@ jobs:
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: 1.22.x
go-version: 1.23.x

- name: Test
run: make cover COVER_MODULES=./docs
Expand All @@ -68,7 +68,7 @@ jobs:
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: 1.22.x
go-version: 1.23.x
cache: false # managed by golangci-lint

- uses: golangci/golangci-lint-action@v6
Expand Down
41 changes: 0 additions & 41 deletions app_121_test.go

This file was deleted.

41 changes: 0 additions & 41 deletions app_122_test.go

This file was deleted.

9 changes: 9 additions & 0 deletions app_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2397,6 +2397,15 @@ func TestNopLogger(t *testing.T) {
app.RequireStart().RequireStop()
}

func TestNopLoggerOptionString(t *testing.T) {
t.Parallel()

assert.Equal(t,
"fx.WithLogger(go.uber.org/fx.init.func1())",
NopLogger.String(),
)
}

func TestCustomLoggerWithPrinter(t *testing.T) {
t.Parallel()

Expand Down
50 changes: 0 additions & 50 deletions internal/fxreflect/stack_120_test.go

This file was deleted.

50 changes: 0 additions & 50 deletions internal/fxreflect/stack_121_test.go

This file was deleted.

50 changes: 0 additions & 50 deletions internal/fxreflect/stack_122_test.go

This file was deleted.

19 changes: 19 additions & 0 deletions internal/fxreflect/stack_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,25 @@ func TestStack(t *testing.T) {
})
}

func TestDeepStack(t *testing.T) {
t.Run("nest", func(t *testing.T) {
// Introduce a few frames.
frames := func() []Frame {
return func() []Frame {
return CallerStack(0, 0)
}()
}()

require.True(t, len(frames) > 3, "expected at least three frames")
for i, name := range []string{"func1.TestDeepStack.func1.1.2", "func1.1", "func1"} {
f := frames[i]
assert.Equal(t, "go.uber.org/fx/internal/fxreflect.TestDeepStack."+name, f.Function)
assert.Contains(t, f.File, "internal/fxreflect/stack_test.go")
assert.NotZero(t, f.Line)
}
})
}

func TestStackCallerName(t *testing.T) {
t.Parallel()

Expand Down