Is there a way to instruct gofmt (or another tool) to reformat field tags 
such that the keys are aligned?

For example:

type Example struct {
Field1 string `json:"x" db:"y"`
Field2 int `json:"ababababc" db:"def"`

Field3 string `json:"zyx" db:"egh"`
Field4 string `json:"z" db:"q"`
}

Would be formatted as

type Example struct {
Field1 string  `json:"x"         db:"y"`
Field2 int     `json:"ababababc" db:"def"`

Field3 string `json:"zyx" db:"egh"`
Field4 string `json:"z"   db:"q"`
}

(View example in fixed font width please)

Is there a way to instruct go vet (or another tool) to report different 
field tag key order?

For example: 

type Example2 struct {
Field1 string `db:"y" json:"x"`
Field2 int `json:"abc" db:"def"`
}

Would output something along the lines of: "field2: different tag order for 
json and db"

Thanks.

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/53dd5bb1-542e-4adc-96e6-e01608b1b7aan%40googlegroups.com.

Reply via email to