jsonstructlint

command module
v3.0.0+incompatible Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 20, 2018 License: MIT Imports: 11 Imported by: 0

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

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL