Skip to content

Commit

Permalink
[pkg/telemetryquerylanguage/contexts/logs] enable gocritic (open-tele…
Browse files Browse the repository at this point in the history
…metry#12798)

Signed-off-by: xin.li <[email protected]>
  • Loading branch information
my-git9 committed Aug 1, 2022
1 parent 37d94f6 commit 80a2337
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions pkg/telemetryquerylanguage/contexts/logs/logs.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
// See the License for the specific language governing permissions and
// limitations under the License.

// nolint:gocritic
package tqllogs // import "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/telemetryquerylanguage/contexts/logs"

import (
Expand Down Expand Up @@ -111,8 +110,7 @@ func newPathGetSetter(path []tql.Field) (tql.GetSetter, error) {
if len(path) == 1 {
return accessResource(), nil
}
switch path[1].Name {
case "attributes":
if path[1].Name == "attributes" {
mapKey := path[1].MapKey
if mapKey == nil {
return accessResourceAttributes(), nil
Expand Down Expand Up @@ -153,16 +151,14 @@ func newPathGetSetter(path []tql.Field) (tql.GetSetter, error) {
if len(path) == 1 {
return accessTraceID(), nil
}
switch path[1].Name {
case "string":
if path[1].Name == "string" {
return accessStringTraceID(), nil
}
case "span_id":
if len(path) == 1 {
return accessSpanID(), nil
}
switch path[1].Name {
case "string":
if path[1].Name == "string" {
return accessStringSpanID(), nil
}
}
Expand Down

0 comments on commit 80a2337

Please sign in to comment.