GoTags
GoTags is a Sublime Text plugin to append or remove tags for Golang struct.
Details
Installs
- Total 8K
- Win 6K
- Mac 1K
- Linux 520
Feb 28 | Feb 27 | Feb 26 | Feb 25 | Feb 24 | Feb 23 | Feb 22 | Feb 21 | Feb 20 | Feb 19 | Feb 18 | Feb 17 | Feb 16 | Feb 15 | Feb 14 | Feb 13 | Feb 12 | Feb 11 | Feb 10 | Feb 9 | Feb 8 | Feb 7 | Feb 6 | Feb 5 | Feb 4 | Feb 3 | Feb 2 | Feb 1 | Jan 31 | Jan 30 | Jan 29 | Jan 28 | Jan 27 | Jan 26 | Jan 25 | Jan 24 | Jan 23 | Jan 22 | Jan 21 | Jan 20 | Jan 19 | Jan 18 | Jan 17 | Jan 16 | Jan 15 | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Windows | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
Mac | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
Linux | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
Readme
- Source
- raw.githubusercontent.com
GoTags
GoTags is a Sublime Text plugin to append or remove tags for Golang struct.
Functionality includes:
- Append JSON tag with snake cased field name or remove JSON tag
- Append XML tag with snake cased field name or remove XML tag
- Append Xorm tag with xorm field type or remove Xorm tag
Usage
By default via the keyboard shortcut: Super + Shift + G
, Super + Shift + T
on OSX or Ctrl + Shift + G
, Ctrl + Shift + T
on other platforms(or change it
in ${packages}/User/Default (plantform).sublime-keymap). Then choice the action
you want.
** Makesure lines type STRUCT_NAME struct{
are in select region. **
For example:
type Example struct {
FieldOne int `` // int field
FieldTwo string `orig tag` // string field
FieldThree time.Time // time field
}
Then select type Example struct {
line (or this is current line) and type the
shortcut, select action JSON: Append tags
:
type Example struct {
FieldOne int `json:"field_one"` // int field
FieldTwo string `orig tag json:"field_two"` // string field
FieldThree time.Time `json:"field_three"` // time field
}
After save with gofmt:
type Example struct {
FieldOne int `json:"field_one"` // int field
FieldTwo string `orig tag json:"field_two"` // string field
FieldThree time.Time `json:"field_three"` // time field
}
Idea from:
gotag: golang auto generate struct tag.