Skip to content

Commit b48d04f

Browse files
authored
Fix XML tags in JSON (#7)
Signed-off-by: Dusan Borovcanin <[email protected]>
1 parent 78a09af commit b48d04f

33 files changed

+968
-502
lines changed

.github/workflows/go.yml

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,20 +6,23 @@ jobs:
66
runs-on: ubuntu-latest
77
steps:
88

9-
- name: Set up Go 1.13
9+
- name: Set up Go 1.18
1010
uses: actions/setup-go@v1
1111
with:
12-
go-version: 1.13
12+
go-version: 1.18
1313
id: go
14-
1514
- name: Check out code into the Go module directory
1615
uses: actions/checkout@v1
17-
18-
- name: test
16+
- name: Lint
17+
run: |
18+
export GOBIN=$HOME/go/bin
19+
export PATH=$PATH:$(go env GOBIN)
20+
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOBIN) v1.46.2
21+
golangci-lint run --no-config --disable-all --enable gosimple --enable govet --enable unused --enable deadcode --timeout 3m
22+
- name: Test
1923
run: |
2024
go test -v -race -tags test -coverprofile=profile.out -covermode=atomic ./...
21-
22-
- name: Upload coverage to Codecov
25+
- name: Upload coverage
2326
uses: codecov/codecov-action@v1
2427
with:
2528
token: ${{ secrets.CODECOV_TOKEN }}

go.mod

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
module github.com/mainflux/senml
22

3-
go 1.17
3+
go 1.18
44

55
require (
6-
github.com/fxamacker/cbor/v2 v2.3.0
7-
github.com/stretchr/testify v1.7.0
6+
github.com/fxamacker/cbor/v2 v2.4.0
7+
github.com/stretchr/testify v1.8.0
88
)
99

1010
require (
11-
github.com/davecgh/go-spew v1.1.0 // indirect
11+
github.com/davecgh/go-spew v1.1.1 // indirect
1212
github.com/pmezard/go-difflib v1.0.0 // indirect
1313
github.com/x448/float16 v0.8.4 // indirect
14-
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c // indirect
14+
gopkg.in/yaml.v3 v3.0.1 // indirect
1515
)

go.sum

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,19 @@
1-
github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8=
21
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
3-
github.com/fxamacker/cbor/v2 v2.3.0 h1:aM45YGMctNakddNNAezPxDUpv38j44Abh+hifNuqXik=
4-
github.com/fxamacker/cbor/v2 v2.3.0/go.mod h1:TA1xS00nchWmaBnEIxPSE5oHLuJBAVvqrtAnWBwBCVo=
2+
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
3+
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
4+
github.com/fxamacker/cbor/v2 v2.4.0 h1:ri0ArlOR+5XunOP8CRUowT0pSJOwhW098ZCUyskZD88=
5+
github.com/fxamacker/cbor/v2 v2.4.0/go.mod h1:TA1xS00nchWmaBnEIxPSE5oHLuJBAVvqrtAnWBwBCVo=
56
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
67
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
78
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
8-
github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY=
9-
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
9+
github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=
10+
github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
11+
github.com/stretchr/testify v1.8.0 h1:pSgiaMZlXftHpm5L7V1+rVB+AZJydKsMxsQBIJw4PKk=
12+
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
1013
github.com/x448/float16 v0.8.4 h1:qLwI1I70+NjRFUR3zs1JPUCgaCXSh3SW62uAKT1mSBM=
1114
github.com/x448/float16 v0.8.4/go.mod h1:14CWIYCyZA/cWjXOioeEpHeN/83MdbZDRQHoFcYsOfg=
1215
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
1316
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
14-
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo=
1517
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
18+
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
19+
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=

senml.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,8 @@ type Record struct {
6767

6868
// Pack consists of SenML records array.
6969
type Pack struct {
70-
XMLName *bool `json:"_,omitempty" xml:"sensml"`
71-
Xmlns string `json:"_,omitempty" xml:"xmlns,attr"`
70+
XMLName *bool `json:"-" xml:"sensml"`
71+
Xmlns string `json:"-" xml:"xmlns,attr"`
7272
Records []Record `xml:"senml"`
7373
}
7474

vendor/github.com/davecgh/go-spew/LICENSE

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/github.com/davecgh/go-spew/spew/bypass.go

Lines changed: 90 additions & 97 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/github.com/davecgh/go-spew/spew/bypasssafe.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/github.com/davecgh/go-spew/spew/common.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/github.com/davecgh/go-spew/spew/dump.go

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/github.com/davecgh/go-spew/spew/format.go

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)