{"repo":"fatih/gomodifytags","free":true,"listed":false,"github":"https://github.com/fatih/gomodifytags","clone":"git clone https://github.com/fatih/gomodifytags.git","description":"Go tool to modify struct field tags","language":"Go","stars":2390,"topics":["go","structs","tags","golang","tool"],"license":"BSD-3-Clause","category":"dev-tools","readme_excerpt":"gomodifytags Go tool to modify/update field tags in structs. gomodifytags makes it easy to update, add or delete the tags in a struct field. You can easily add new tags, update existing tags (such as appending a new key, i.e: db , xml , etc..) or remove existing tags. It also allows you to add and remove tag options. It's intended to be used by an editor, but also has modes to run it from the terminal. Read the usage section below for more information. Install Supported editors vim-go with :GoAddTags and :GoRemoveTags go-plus (atom) with commands golang:add-tags and golang:remove-tags vscode-go with commands Go: Add Tags and Go: Remove Tags A (Acme) with commands addtags and rmtags emacs-go-tag with commands go-tag-add and go-tag-remove TextMate2 Usage gomodifytags has multiple ways to modify a tag. Let's start with an example package: We have to first pass a file. For that we can use the -file flag: What are these? There are four different ways of defining which field tags to change: -struct : This accepts the struct name. i.e: -struct Server . The name should be a valid type name. The -struct flag selects the whole struct, and thus it will operate on all fields. -field : This accepts a field name. i.e: -field Address . Useful to select a certain field. The name should be a valid field name. The -struct flag is required. -offset : This accepts a byte offset of the file. Useful for editors to pass the position under the cursor. i.e: -offset 548 . The offset has to be inside a","default_branch":null,"files":null,"tree":[],"storefront":"/r/fatih","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/fatih/gomodifytags/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}