Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ jobs:
- oldstable
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
- uses: actions/setup-go@0aaccfd150d50ccaeb58ebd88d36e91967a5f35b
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8
- uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00
with:
go-version: ${{ matrix.go-version }}
- name: build
Expand All @@ -29,7 +29,7 @@ jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
- uses: golangci/golangci-lint-action@1481404843c368bc19ca9406f87d6e0fc97bdcfd
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8
- uses: golangci/golangci-lint-action@4afd733a84b1f43292c63897423277bb7f4313a9
with:
version: v2.0.2
version: v2.4.0
5 changes: 5 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ linters:
- dupl
- dupword
- durationcheck
- embeddedstructfieldcheck
- err113
- errchkjson
- errname
Expand All @@ -22,6 +23,7 @@ linters:
- exptostd
- fatcontext
- forcetypeassert
- funcorder
- ginkgolinter
- gocheckcompilerdirectives
- gochecknoinits
Expand Down Expand Up @@ -81,6 +83,7 @@ linters:
- whitespace
- zerologlint
disable:
- arangolint
- cyclop
- depguard
- exhaustruct
Expand All @@ -96,11 +99,13 @@ linters:
- mnd
- nestif
- nlreturn
- noinlineerr
- paralleltest
- testpackage
- varnamelen
- wrapcheck
- wsl
- wsl_v5
exclusions:
generated: lax
presets:
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ which you can try by running
echo '{"nested":{"bar":true,"foo":"baz"}}' \
'{"nested":{"bar":false,"foo":null}}' \
'{"nested":{"bar":true,"foo":""}}' \
| gojsonstruct --package-name mypackage --typename MyType
| gojsonstruct --package-name mypackage --type-name MyType
```

generates the output
Expand Down
2 changes: 1 addition & 1 deletion cmd/gojsonstruct/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ var (
stringTags = pflag.Bool("string-tags", false, "generate ,string tags")
structTagName = pflag.String("struct-tag-name", "", "struct tag name")
typeComment = pflag.String("type-comment", "", "type comment")
typeName = pflag.String("typename", "T", "type name")
typeName = pflag.String("type-name", "T", "type name")
intType = pflag.String("int-type", "", "integer type")
useJSONNumber = pflag.Bool("use-json-number", false, "use json.Number")
goFormat = pflag.Bool("go-format", true, "format generated Go code")
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ require (
github.com/alecthomas/assert/v2 v2.6.0
github.com/fatih/camelcase v1.0.0
github.com/fatih/structtag v1.2.0
github.com/spf13/pflag v1.0.6
github.com/spf13/pflag v1.0.10
gopkg.in/yaml.v3 v3.0.1
)

Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ github.com/fatih/structtag v1.2.0 h1:/OdNE99OxoI/PqaW/SuSK9uxxT3f/tcSZgon/ssNSx4
github.com/fatih/structtag v1.2.0/go.mod h1:mBJUNpUnHmRKrKlQQlmCrh5PuhftFbNv8Ys4/aAZl94=
github.com/hexops/gotextdiff v1.0.3 h1:gitA9+qJrrTCsiCl7+kh75nPqQt1cx4ZkudSTLoUqJM=
github.com/hexops/gotextdiff v1.0.3/go.mod h1:pSWU5MAI3yDq+fZBTazCSJysOMbxWL1BSow5/V2vxeg=
github.com/spf13/pflag v1.0.6 h1:jFzHGLGAlb3ruxLB8MhbI6A8+AQX/2eW4qeyNZXNp2o=
github.com/spf13/pflag v1.0.6/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
github.com/spf13/pflag v1.0.10 h1:4EBh2KAYBwaONj6b2Ye1GiHfwjqyROoF4RwYO+vPwFk=
github.com/spf13/pflag v1.0.10/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
Expand Down