Skip to content

M1ndo/gofmt-tag

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Gofmt-Tag

MELPA MELPA Stable

An Emacs package to align Golang struct tags that uses formattag While gofmt exists in go-mode which is just `go fmt` is some where pretty equivalent to formattag, However i find that formattag handles tags better when dealing with json and xml.

Demo Gif

Usage

First let’s download formattag. Either compile it yourself or download a prebuilt binary

cd /tmp && wget https://github.com/momaek/formattag/releases/download/v0.0.9/formattag.tar.gz
gunzip -d formattag.tar.gz && tar -xf formattag.tar
sudo cp formattag-linux-amd64 /usr/local/bin/formattag

Now let’s use gofmt-tag. In Doom Emacs packages.el

(package! gofmt-tag :recipe (:host github :repo "m1ndo/gofmt-tag"))

In Doom Emacs / Vanilla Emacs

(require 'gofmt-tag)
(add-hook 'go-mode-hook #'(lambda () (gofmt-tag-mode)))

About

An Emacs package to align Golang struct tags (like gofmt but better)

Resources

License

Stars

Watchers

Forks

Packages

No packages published