goccy

goccy / gotmplfmt

Public

Go's template formatter

11
0
100% credibility
Found Apr 21, 2026 at 11 stars -- GitGems finds repos before they trend. Get early access to the next one.
Sign Up Free
AI Analysis
Go
AI Summary

gotmplfmt formats template files containing Go code by applying standard code formatting rules to the code sections while preserving the template placeholders unchanged.

How It Works

1
📄 Spot messy templates

You notice your files with code snippets and placeholders look jumbled and hard to read.

2
🔍 Discover the tidier

You find a handy tool that cleans up the code parts while leaving placeholders untouched.

3
⬇️ Grab the tool

You easily download or add the tidier to your everyday tools.

4
Clean your files

You select your template files and let the tool straighten everything with one simple action.

5
👀 Admire the results

Your code lines up perfectly, indents feel right, and all placeholders stay exactly as they were.

🎉 Templates shine

Now your files generate neat code every time, making your projects look professional and easy to maintain.

Sign up to see the full architecture

4 more

Sign Up Free

Star Growth

See how this repo grew from 11 to 11 stars Sign Up Free
Repurpose This Repo

Repurpose is a Pro feature

Generate ready-to-use prompts for X threads, LinkedIn posts, blog posts, YouTube scripts, and more -- with full repo context baked in.

Unlock Repurpose
AI-Generated Review

What is gotmplfmt?

gotmplfmt is a Go tool that formats text/template files by applying gofmt to embedded Go code, while preserving template actions like {{ if }}, {{ range }}, and {{ template }} exactly as-is. It solves the pain of unaligned structs, sloppy indents, and gofmt-incompatible templates in .go.tmpl files used for code generation or configs. Install via go get or go install for the CLI, which mimics gofmt flags like -w, -l, and -d.

Why is it gaining traction?

Unlike basic prettifiers, it's gofmt-backed for production-ready output, supports goimports or gofumpt swaps, custom delimiters, and multi-file {{ define }} blocks—ensuring rendered Go stays identical. Idempotent runs and render-equivalence tests mean no surprises in pipelines or go github actions. Devs love the CLI simplicity for go template playground experiments or go github examples.

Who should use this?

Go backend engineers generating structs or funcs via templates, like in Helm charts, OpenAPI clients, or internal codegen tools. Teams enforcing style in go repository github setups, especially with go template if-else-range heavy files. CI/CD folks adding it to go github actions for linting before go github graphql or go github google integrations.

Verdict

Solid for cleaning go template syntax in small projects—90%+ test coverage and thorough docs help—but with 11 stars and 1.0% credibility, it's early-stage; test thoroughly before prod. Worth a spin if gofmt chaos hits your templates.

(198 words)

Sign up to read the full AI review Sign Up Free

Similar repos coming soon.