GoTags
GoTags is a Sublime Text plugin to append or remove tags for Golang struct.
Details
Installs
- Total 8K
- Win 6K
- Mac 1K
- Linux 523
May 9 | May 8 | May 7 | May 6 | May 5 | May 4 | May 3 | May 2 | May 1 | Apr 30 | Apr 29 | Apr 28 | Apr 27 | Apr 26 | Apr 25 | Apr 24 | Apr 23 | Apr 22 | Apr 21 | Apr 20 | Apr 19 | Apr 18 | Apr 17 | Apr 16 | Apr 15 | Apr 14 | Apr 13 | Apr 12 | Apr 11 | Apr 10 | Apr 9 | Apr 8 | Apr 7 | Apr 6 | Apr 5 | Apr 4 | Apr 3 | Apr 2 | Apr 1 | Mar 31 | Mar 30 | Mar 29 | Mar 28 | Mar 27 | Mar 26 | Mar 25 | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Windows | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 2 |
Mac | 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 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
Linux | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 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 |
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.