1
0
mirror of https://github.com/open-telemetry/opentelemetry-go.git synced 2026-06-03 18:35:08 +02:00

[chore] Add asasalint linter (#5653)

Add https://golangci-lint.run/usage/linters/#asasalint linter.

Fix the bugs detected by the linter.

PR in Contrib:
https://github.com/open-telemetry/opentelemetry-go-contrib/pull/5957
This commit is contained in:
Robert Pająk
2024-07-31 08:41:11 +02:00
committed by GitHub
parent f290782ed2
commit e2b0751cd1
3 changed files with 3 additions and 2 deletions
+1
View File
@@ -9,6 +9,7 @@ linters:
disable-all: true
# Specifically enable linters we want to use.
enable:
- asasalint
- depguard
- errcheck
- errorlint
+1 -1
View File
@@ -318,7 +318,7 @@ type logSink struct {
func (l *logSink) Error(err error, msg string, keysAndValues ...interface{}) {
l.err, l.msg, l.keysAndValues = err, msg, keysAndValues
l.LogSink.Error(err, msg, keysAndValues)
l.LogSink.Error(err, msg, keysAndValues...)
}
func testErrKind[T any](f func() T, msg string, k log.Kind) func(*testing.T) {
+1 -1
View File
@@ -191,7 +191,7 @@ func (l *logSink) Enabled(int) bool { return true }
func (l *logSink) Info(level int, msg string, keysAndValues ...any) {
l.level, l.msg, l.keysAndValues = level, msg, keysAndValues
l.LogSink.Info(level, msg, keysAndValues)
l.LogSink.Info(level, msg, keysAndValues...)
}
func TestLoggerProviderLogger(t *testing.T) {