Skip to content

Latest commit

 

History

History
43 lines (38 loc) · 1.72 KB

README.md

File metadata and controls

43 lines (38 loc) · 1.72 KB

gtag

gtag is a simple tool for Golang tag, currently only support for tag formatter.

it'll transform your mess struct tag into beauty one

Before

Installation

This tool requires Go installed. To get the latest released version use:

GO111MODULE=off go get github.com/adzimzf/gtag/cmd/gtag
go install github.com/adzimzf/gtag/cmd/gtag

Integration

  • Goland (Jetbrains Go IDE)

    1. To integrate with Goland you need file watcher plugin
    2. Go to file watcher setting
    3. Click + button or press Alt+Insert
    4. Select custom
    5. Fill the program input field with <Your go bin location>/gtag

      Goland Configuration

  • VSCode

    1. To integrate with VSCode you need this plugin
    2. After you have already installed it, press CTRL+P then search setting.json to edit your file configuration
    3. Add the file with this json
      "runOnSave.commands": [
              {
                  "match": ".*\\.go$",
                  "notMatch": "[\\\\\\/]_[^\\\\\\/]*\\.go$",
                  "command": "gtag -i=${file} -w",
                  "runIn": "backend"
              },
          ]
    4. Save it, and whenever you save it'll reformat your struct tags