Categorygithub.com/wayneashleyberry/jsonstructlint/v4
modulepackage
4.0.0
Repository: https://github.com/wayneashleyberry/jsonstructlint.git
Documentation: pkg.go.dev

# README

An opinionated linter for json struct tags in Go

Build Status Go Report Card

go get -u github.com/wayneashleyberry/jsonstructlint
jsonstructlint ./...
samples/testdata.go:14:2: "x_y" is not camelcase
samples/testdata.go:16:2: "foo bar" contains whitespace
samples/testdata.go:17:2: "TitleCase" is not camelcase
samples/testdata.go:18:2: "a b" contains whitespace
samples/testdata.go:12:2: F2 is missing a struct tag
samples/testdata.go:13:2: F3 is missing a struct tag
samples/testdata.go:25:3: "Inline Struct" contains whitespace
samples/testdata.go:30:4: "Super Inline" contains whitespace
samples/testdata.go:40:4: "FileName" is not camelcase
samples/testdata.go:41:4: MissingStructTag is missing a struct tag

Rules

  • json struct tags must be lower camel case eg. camelCase
  • json struct tags must not contain whitespace
  • json struct tags must exist on all fields, if they exist on one

# Packages

No description provided by the author
No description provided by the author