Skip to content

Latest commit

 

History

History
46 lines (36 loc) · 613 Bytes

README.md

File metadata and controls

46 lines (36 loc) · 613 Bytes

sortkeys-go

To install:

go get -u github.com/jeffreylo/sortkeys-go
λ sortkeys-go -h
Usage of sortkeys-go:
  -file string
    	Filename to be parsed
  -o string
    	Output filename
  -p string
    	Comma-separated ordered list of field names to prioritize
  -w	Write to -file

Example

Given the following:

type Example struct {
	// B is a comment for B.
	B string
	// A is a comment for A.
	A string
}

sortkeys-go rewrites to:

type Example struct {
	// A is a comment for A.
	A string

	// B is a comment for B.
	B string
}

See docs for more details.