{"id":20113735,"url":"https://github.com/brantou/emacs-go-tag","last_synced_at":"2025-07-06T23:06:48.245Z","repository":{"id":27208394,"uuid":"109939854","full_name":"brantou/emacs-go-tag","owner":"brantou","description":"Edit field tags for golang struct fields","archived":false,"fork":false,"pushed_at":"2023-01-11T11:44:21.000Z","size":185,"stargazers_count":62,"open_issues_count":2,"forks_count":6,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-06T12:37:56.755Z","etag":null,"topics":["emacs-lisp","emacs-plugin","go-tools","golang"],"latest_commit_sha":null,"homepage":"","language":"Emacs Lisp","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/brantou.png","metadata":{"files":{"readme":"README.org","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-11-08T07:02:00.000Z","updated_at":"2025-02-14T13:21:49.000Z","dependencies_parsed_at":"2023-01-14T06:13:27.890Z","dependency_job_id":null,"html_url":"https://github.com/brantou/emacs-go-tag","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/brantou/emacs-go-tag","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brantou%2Femacs-go-tag","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brantou%2Femacs-go-tag/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brantou%2Femacs-go-tag/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brantou%2Femacs-go-tag/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/brantou","download_url":"https://codeload.github.com/brantou/emacs-go-tag/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brantou%2Femacs-go-tag/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263986257,"owners_count":23539809,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["emacs-lisp","emacs-plugin","go-tools","golang"],"created_at":"2024-11-13T18:25:36.887Z","updated_at":"2025-07-06T23:06:48.218Z","avatar_url":"https://github.com/brantou.png","language":"Emacs Lisp","funding_links":[],"categories":[],"sub_categories":[],"readme":"#+TITLE: emacs-go-tag \n[[http://www.gnu.org/licenses/gpl-3.0.html][file:https://img.shields.io/badge/license-GPL_v3-green.svg]]\n[[https://melpa.org/#/go-tag][file:https://melpa.org/packages/go-tag-badge.svg]]\n[[https://stable.melpa.org/#/go-tag][file:https://stable.melpa.org/packages/go-tag-badge.svg]]\n\n* Introduction\n  :PROPERTIES:\n  :ID:       433a1d5f-9353-496f-a783-8c123cc0a633\n  :END:\n\n  Edit field tags for golang struct fields, based on [[https://github.com/fatih/gomodifytags][gomodifytags]].\n  This package is inspired by ~GoAddTags~ of [[https://github.com/fatih/vim-go][vim-go]] and [[https://github.com/syohex/emacs-go-add-tags][go-add-tags]].\n\n* gomodifytags\n  :PROPERTIES:\n  :ID:       f51e9e98-85ed-428a-90ba-d0727a257402\n  :END:\n  Go tool to modify/update field tags in structs.\n  ~gomodifytags~ makes it easy to update, add or delete the tags in a struct field.\n  It can be installed with\n  #+BEGIN_SRC shell :eval strip-export\n    go install github.com/fatih/gomodifytags@latest\n  #+END_SRC\n\n* Installation\n  :PROPERTIES:\n  :ID:       edb6d6eb-9d05-418c-81d9-7452b9db3d69\n  :END:\n\nAvailable on all major ~package.el~ community maintained repos -\n[[https://stable.melpa.org/#/][MELPA Stable]] and [[https://melpa.org/#/][MELPA]] repos.\n\nMELPA Stable is recommended as it has the latest stable version.\nMELPA has a development snapshot for users who don't mind breakage but\ndon't want to run from a git checkout.\n\nYou can install ~go-tag~ using the following command:\n\n~M-x package-install [RET] go-tag [RET]~\n\nor if you'd rather keep it in your dotfiles:\n\n#+BEGIN_SRC elisp\n  (unless (package-installed-p 'go-tag)\n    (package-refresh-contents)\n    (package-install 'go-tag))\n#+END_SRC\n\nIf the installation doesn't work try refreshing the package list:\n\n~M-x package-refresh-contents~\n\n* Commands\n  :PROPERTIES:\n  :ID:       dbee016c-6edd-4999-9303-419d35469ad2\n  :END:\n  If you are familiar with ~GoAddTags~ AND ~GoRemoveTags~ of [[https://github.com/fatih/vim-go][vim-go]] , ~go-tag~ you will get started quickly.\n  - ~go-tag-add~\n    #+BEGIN_QUOTE\n    :[range]go-tag-add [key],[option] [key1],[option] ...\n    #+END_QUOTE\n\n    Adds field tags for the fields of a struct. If called inside a struct it\n    automatically add field tags with the ~json~ key and the value\n    automatically generated based on the field name. An error message is given\n    if it's called outside a struct definition or if the file is not correctly\n    formatted.\n\n    If [range] is given, only the selected fields will be changed.\n\n    The default ~json~ can be changed by providing one or more [key]\n    arguments. An example of adding ~xml~ and ~db~ would be:\n\n    #+BEGIN_QUOTE\n    :go-tag-add xml db\n    #+END_QUOTE\n\n    If [option] is passed it'll either add a new tag with an option or will\n    modify existing tags. An example of adding ~omitempty~ to all ~json~\n    fields would be:\n    #+BEGIN_QUOTE\n    :go-tag-add json,omitempty\n    #+END_QUOTE\n\n    You can define a constant value instead of the default field based value.\n    For example the following command will add ~`valid:\"1\"`~ to all fields.\n    #+BEGIN_QUOTE\n    :go-tag-add valid=1\n    #+END_QUOTE\n\n    [[https://github.com/brantou/emacs-go-tag/blob/master/img/go-tag-add.gif]]\n  - ~go-tag-remove~\n\n    #+BEGIN_QUOTE\n    :[range]go-tag-remove [key],[option] [key1],[option1] ...\n    #+END_QUOTE\n\n    Rmove field tags for the fields of a struct. If called inside a struct it\n    automatically remove all field tags. An error message is given if it's\n    called outside a struct definition or if the file is not correctly\n    formatted\n\n    If [range] is given, only the selected fields will be changed.\n\n    If [key] is given, it will only remove those keys. Example:\n\n    #+BEGIN_QUOTE\n    :go-tag-remove json\n    #+END_QUOTE\n\n    If [option] is passed with a [key], it will only remove the options.\n    Example, this will only remove ~omitempty~ options from fields containing\n    ~json~:\n\n    #+BEGIN_QUOTE\n    :go-tag-remove json,omitempty\n    #+END_QUOTE\n    [[https://github.com/brantou/emacs-go-tag/blob/master/img/go-tag-remove.gif]]\n\n  - ~go-tag-refresh~ (Useful when designing structures)\n    #+BEGIN_QUOTE\n    :[range]go-tag-refresh [key],[option] [key1],[option] ...\n    #+END_QUOTE\n\n    Equal to:\n    #+BEGIN_QUOTE\n    :[range]go-tag-remove [key] [key1] ...\n    \n    :[range]go-tag-add [key],[option] [key1],[option] ...\n    #+END_QUOTE\n\n* Configuration\n  :PROPERTIES:\n  :ID:       9f364afb-69ae-47dc-ae2e-d76bdcefc928\n  :END:\n\n  support the following transformations:\n  - ~snakecase~: ~BaseDomain~ -\u003e ~base_domain~\n  - ~camelcase~: ~BaseDomain~ -\u003e ~baseDomain~\n  - ~lispcase~: ~BaseDomain~ -\u003e ~base-domain~\n\n  #+BEGIN_SRC elisp :eval strip-export\n    (setq go-tag-args (list \"-transform\" \"camelcase\"))\n  #+END_SRC\n\n  #+BEGIN_SRC elisp :eval strip-export\n    (with-eval-after-load 'go-mode\n      (define-key go-mode-map (kbd \"C-c t\") #'go-tag-add)\n      (define-key go-mode-map (kbd \"C-c T\") #'go-tag-remove))\n  #+END_SRC\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrantou%2Femacs-go-tag","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbrantou%2Femacs-go-tag","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrantou%2Femacs-go-tag/lists"}