Skip to content

jeffreylo/sortkeys-go

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

Sorts struct fields in order

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages