Skip to content

Commit 2f8c4fd

Browse files
author
Jonas Hagberg
committed
Auto-format go code with golines
1 parent d06d23e commit 2f8c4fd

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

init.lua

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -614,6 +614,7 @@ require('lazy').setup({
614614
end,
615615
formatters_by_ft = {
616616
lua = { 'stylua' },
617+
go = { 'golines' },
617618
-- Conform can also run multiple formatters sequentially
618619
-- python = { "isort", "black" },
619620
--
@@ -865,5 +866,8 @@ require('lazy').setup({
865866
},
866867
})
867868

869+
require('conform').formatters.golines = {
870+
prepend_args = { '-w -m 128 --no-reformat-tags' },
871+
}
868872
-- The line beneath this is called `modeline`. See `:help modeline`
869873
-- vim: ts=2 sts=2 sw=2 et

0 commit comments

Comments
 (0)