Skip to content
| Marketplace
Sign in
Visual Studio Code>Programming Languages>Nifty Go Tools: Struct Tags & Error FoldingNew to Visual Studio Code? Get it now.
Nifty Go Tools: Struct Tags & Error Folding

Nifty Go Tools: Struct Tags & Error Folding

Nifty

| (0) | Free
Go power tools that don't need anything installed: fold if err != nil blocks, add or remove struct tags in any case style, generate constructors, and jump between a file and its test.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Nifty Go Tools

Go power tools that don't need anything installed: fold if err != nil blocks, add or remove struct tags in any case style, generate constructors, and jump between a file and its test.

Maintained. No sign-in. No telemetry. Works in VS Code, Cursor, Windsurf, VSCodium and other editors that use Open VSX.

Features

Short if err != nil checks folded away in a Go file, so each function's happy path reads top to bottom

The light bulb on a struct offers json, yaml and db tags and a constructor

An Order struct with aligned json and db tags, and a generated NewOrder constructor below it

  • Fold if err != nil. Short error checks fold away when you open a Go file, so the happy path reads top to bottom, the way GoLand shows it. Fold Error Checks and Unfold Error Checks toggle them, and each one folds on its own from the gutter. Blocks with an else, or longer than 5 lines, stay open. Functions, structs, import groups and comments still fold from the gutter as usual.
  • Struct tags. Put the cursor in a struct and open the light bulb (Ctrl+.) to add json, yaml or db tags to every exported field, or remove a tag key. Existing tags and ,omitempty are kept. Names follow your style (json camelCase and snake_case elsewhere by default, configurable per key), and fields and tags are lined up like gofmt does. Add Struct Tags… offers more keys: xml, toml, bson, mapstructure, validate.
  • Generate a constructor. NewUser(id int64, firstName string, …) *User with every field, written below the struct.
  • Go to Test / Implementation. Jump between store.go and store_test.go. The test file is created with the right package and testing import if it doesn't exist yet. Optionally bind it to Ctrl+Shift+T.
  • Nothing to install. Works on the source text, so it doesn't need Go, gopls or gomodifytags, and it runs alongside the official Go extension.
  • Works in the browser on vscode.dev and github.dev.

Commands

Command What it does
Nifty Go Tools: Fold Error Checks / Unfold Error Checks Fold or unfold every short if err != nil block
Nifty Go Tools: Add Struct Tags… Add a tag key to the struct at the cursor
Nifty Go Tools: Remove Struct Tags… Remove a tag key
Nifty Go Tools: Generate Constructor Write a New… function for the struct
Nifty Go Tools: Go to Test / Implementation Switch between a file and its _test.go

Settings

Setting Default What it does
nifty.go.foldErrorsOnOpen true Fold error checks when a file opens
nifty.go.errorFoldMaxLines 5 Longest error-check body to fold
nifty.go.tagCase {} Name style per tag key, e.g. { "json": "snake" }
nifty.go.omitempty false Add ,omitempty to new tags
nifty.go.alignTags true Align fields and tags like gofmt
nifty.go.quickTags ["json","yaml","db"] Tag keys offered in the light bulb
nifty.go.testKeybinding false Use Ctrl+Shift+T in Go files for Go to Test

Install

  • VS Code: search for "Nifty Go Tools" in the Extensions view, or install from the Visual Studio Marketplace.
  • Cursor, Windsurf, VSCodium, Kiro, Antigravity: install from Open VSX.

Privacy

This extension collects no telemetry and needs no account.

More Nifty tools

  • Nifty Code Runner: Run Code in 25+ Languages: Run the current file or selection in 25+ languages in the terminal, with input support, your own commands and no telemetry. (Open VSX)
  • Nifty .NET Explorer: Solution & Test Explorer: A solution explorer and test explorer for .NET in VS Code, Cursor, Windsurf and VSCodium: projects, references and files from .sln/.slnx, and xUnit, NUnit and MSTest tests in the Testing view. (Open VSX)
  • Nifty C# Scratchpad: Run C# Snippets & NuGet: Run C# snippets instantly with NuGet packages and rich Dump() output, a LINQPad-style scratchpad and Polyglot Notebooks replacement. (Open VSX)
  • Nifty C# Templates: New Class, Record & Namespace: New C# class, interface, record, enum, test and controller files with the right namespace, plus namespace syncing. (Open VSX)
  • Nifty Colors: Swatches & Picker in Every Language: Colour swatches and VS Code's picker in any file: CSS, Tailwind, Flutter, Swift, Android, C# and Unity colours. Convert formats and check WCAG contrast on hover. (Open VSX)
  • Nifty CSS Classes: Class Name Completion: Complete CSS class names in HTML, JSX, Vue, Svelte, PHP and templates from your stylesheets, including SCSS nesting and linked files, with hover and go to definition. (Open VSX)

See all 100+ Nifty extensions and web tools at https://getnifty.dev

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
  • Your Privacy Choices
  • Consumer Health Privacy
© 2026 Microsoft