Skip to content

Commit

Permalink
Merge pull request #80 from nkmr-jp/develop
Browse files Browse the repository at this point in the history
Upgrade dependencies
  • Loading branch information
nkmr-jp authored Jan 17, 2025
2 parents dccc1de + 7b43335 commit a2fbd09
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 10 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: '1.22.x'
go-version: '1.23.x'
cache: false
- name: golangci-lint
uses: golangci/golangci-lint-action@v6
with:
version: v1.54.1
version: v1.62.2
6 changes: 3 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
go: ["1.21.x", "1.22.x"]
go: ["1.22.x", "1.23.x"]
include:
- go: 1.22.x
- go: 1.23.x
steps:
- name: Checkout
uses: actions/checkout@v4
Expand All @@ -27,4 +27,4 @@ jobs:
- name: Test
run: make cover
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
uses: codecov/codecov-action@v5
2 changes: 1 addition & 1 deletion .go-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.21.0
1.23.2
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ require (
github.com/davecgh/go-spew v1.1.1
github.com/logrusorgru/aurora/v4 v4.0.0
github.com/samber/lo v1.47.0
github.com/stretchr/testify v1.9.0
github.com/stretchr/testify v1.10.0
go.uber.org/zap v1.27.0
gopkg.in/natefinch/lumberjack.v2 v2.2.1
)
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZb
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/samber/lo v1.47.0 h1:z7RynLwP5nbyRscyvcD043DWYoOcYRv3mV8lBeqOCLc=
github.com/samber/lo v1.47.0/go.mod h1:RmDH9Ct32Qy3gduHQuKJ3gW1fMHAnE/fAzQuf6He5cU=
github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg=
github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA=
github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto=
go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE=
go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0=
Expand Down
2 changes: 1 addition & 1 deletion pretty.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ func (l *prettyLogger) logWithError(msg string, level zapcore.Level, err error,
err2 := l.Logger.Output(
4,
l.coloredLevel(level).String()+" "+l.coloredMsg(
fmt.Sprintf("%s%s%s", msg, separator, au.Magenta(err.Error())),
fmt.Sprintf("%s%s%s", msg, separator, au.Magenta(fmt.Sprintf("%v", err))),
level, fields,
),
)
Expand Down
10 changes: 10 additions & 0 deletions pretty_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,16 @@ func Test_prettyLogger_logWithError(t *testing.T) {
l.logWithError("test message", zapcore.InfoLevel, errors.New("some error"), nil)
assert.Contains(t, buf.String(), "[INTERNAL ERROR] ")
})

t.Run("when error is nil", func(t *testing.T) {
outputType = PrettyOutput
severityLevel = zapcore.DebugLevel

var buf bytes.Buffer
l := newPrettyLogger(&buf, os.Stderr)
l.logWithError("test message", zapcore.InfoLevel, nil, nil)
assert.Contains(t, buf.String(), "<nil>")
})
}

func Test_prettyLogger_coloredLevel(t *testing.T) {
Expand Down

0 comments on commit a2fbd09

Please sign in to comment.