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

Use already enabled revive linter and add depguard (#2883)

* Refactor golangci-lint conf

Order settings alphabetically.

* Add revive settings to golangci conf

* Check blank imports

* Check bool-literal-in-expr

* Check constant-logical-expr

* Check context-as-argument

* Check context-key-type

* Check deep-exit

* Check defer

* Check dot-imports

* Check duplicated-imports

* Check early-return

* Check empty-block

* Check empty-lines

* Check error-naming

* Check error-return

* Check error-strings

* Check errorf

* Stop ignoring context first arg in tests

* Check exported comments

* Check flag-parameter

* Check identical branches

* Check if-return

* Check increment-decrement

* Check indent-error-flow

* Check deny list of go imports

* Check import shadowing

* Check package comments

* Check range

* Check range val in closure

* Check range val address

* Check redefines builtin id

* Check string-format

* Check struct tag

* Check superfluous else

* Check time equal

* Check var naming

* Check var declaration

* Check unconditional recursion

* Check unexported return

* Check unhandled errors

* Check unnecessary stmt

* Check unnecessary break

* Check waitgroup by value

* Exclude deep-exit check in example*_test.go files
This commit is contained in:
Tyler Yahn
2022-05-19 13:15:07 -07:00
committed by GitHub
parent c5809aa8c7
commit 1f5b159161
113 changed files with 767 additions and 449 deletions
+6 -6
View File
@@ -1008,16 +1008,16 @@ func protoToInts(proto string) (int, int) {
func kvStr(kvs []attribute.KeyValue) string {
sb := strings.Builder{}
sb.WriteRune('[')
_, _ = sb.WriteRune('[')
for idx, attr := range kvs {
if idx > 0 {
sb.WriteString(", ")
_, _ = sb.WriteString(", ")
}
sb.WriteString((string)(attr.Key))
sb.WriteString(": ")
sb.WriteString(attr.Value.Emit())
_, _ = sb.WriteString((string)(attr.Key))
_, _ = sb.WriteString(": ")
_, _ = sb.WriteString(attr.Value.Emit())
}
sb.WriteRune(']')
_, _ = sb.WriteRune(']')
return sb.String()
}