Add field tags for struct fields. This package is inspired by GoAddTags
of vim-go.
go-add-tags
is available on MELPA and MELPA stable
You can install go-add-tags
with the following command.
M-x package-install [RET] go-add-tags [RET]
Insert tag at current line. You can input multiple tags at once by comma, like json,yaml
.
If region is enabled, then tags are inserted in lines in region. And current-prefix-key
is specified,
then you can choose field style function.
How to convert field in tag from field name.
snake-case
lower-camel-case
upper-camel-case
original
(custom-set-variables
'(go-add-tags-style 'lower-camel-case))
(with-eval-after-load 'go-mode
(define-key go-mode-map (kbd "C-c t") #'go-add-tags))