Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
muir committed Aug 24, 2022
1 parent 4e78bb8 commit 067fc0a
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 11 deletions.
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -52,3 +52,7 @@ golanglint:
# binary will be $(go env GOPATH)/bin/golangci-lint
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $$(go env GOPATH)/bin v1.45.2
golangci-lint --version

lint:;
golangci-lint run

25 changes: 14 additions & 11 deletions xopjson/jsonlogger_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,16 +65,15 @@ type checkConfig struct {
}

type checker struct {
tlog *xoptest.TestLogger
config checkConfig
hasAttributesObject bool
spansSeen []bool
requestsSeen []bool
messagesNotSeen map[string][]int
spanIndex map[string]int
requestIndex map[string]int
accumulatedSpans map[string]map[string]interface{}
sequencing map[string]int
tlog *xoptest.TestLogger
config checkConfig
spansSeen []bool
requestsSeen []bool
messagesNotSeen map[string][]int
spanIndex map[string]int
requestIndex map[string]int
accumulatedSpans map[string]map[string]interface{}
sequencing map[string]int
}

func TestASingleLine(t *testing.T) {
Expand Down Expand Up @@ -314,7 +313,11 @@ func (c *checker) line(t *testing.T, super supersetObject) {
c.messagesNotSeen[super.Msg] = c.messagesNotSeen[super.Msg][1:]
assert.Truef(t, super.Timestamp.Round(time.Millisecond).Equal(line.Timestamp.Round(time.Millisecond)), "timestamps %s vs %s", line.Timestamp, super.Timestamp)
assert.Equal(t, int(line.Level), super.Level, "level")
compareData(t, line.Data, "xoptest.Data", super.Attributes, "xopjson.Attributes")
if c.config.hasAttributesObject {
compareData(t, line.Data, "xoptest.Data", super.Attributes, "xopjson.Attributes")
} else {
assert.Empty(t, super.Attributes)
}
}

func (c *checker) span(t *testing.T, super supersetObject) {
Expand Down

0 comments on commit 067fc0a

Please sign in to comment.