feat(strct-tags): add support for tag options (#126)
* feat(struct_tags): add options support * refactor(struct-tags): give input field better name * feat(struct-tag): add default option * refactor: make it work on neovim version below 0.12 * chore(struct-tags): update the demo * refactor: unite struct_tags util with main logic
This commit is contained in:
parent
0de1892ca9
commit
7a18d9f7bd
19 changed files with 301 additions and 15 deletions
|
|
@ -72,6 +72,9 @@ Requirements:
|
|||
" add json tag
|
||||
:GoTagAdd json
|
||||
|
||||
" add json tag with omitempty option
|
||||
:GoTagAdd json=omitempty
|
||||
|
||||
" remove yaml tag
|
||||
:GoTagRm yaml
|
||||
```
|
||||
|
|
@ -233,6 +236,8 @@ require("gopher").setup {
|
|||
transform = "snakecase",
|
||||
-- default tags to add to struct fields
|
||||
default_tag = "json",
|
||||
-- default tag option added struct fields, set to nil to disable
|
||||
option = nil,
|
||||
},
|
||||
iferr = {
|
||||
-- choose a custom error message
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue