Skip to content

Latest commit

 

History

History
46 lines (36 loc) · 1002 Bytes

File metadata and controls

46 lines (36 loc) · 1002 Bytes

Lint Struct Padding

Description

You can read this article to know more about performance improvement on golang structs.
This linter helps you find (and fix) the ordering issues of your golang structs fields.

Installation

go install github.com/majidalaeinia/lintstructpadding@latest
sudo mv $(go env GOPATH)/bin/lintstructpadding /usr/bin

Run the Linter

specific file

lintstructpadding /path/to/a/singlefile.go

complete source code

cd /path/to/your/source/code
lintstructpadding

Fix Struct Padding

specific file

lintstructpadding --fix /path/to/a/singlefile.go

complete source code

cd /path/to/your/source/code
lintstructpadding --fix

TODO

  • Add tests
  • Remove blank lines on struct fixing
  • Improve README file with a terminal GIF showing what it does
  • Improve installation