DevOps Articles

Curated articles, resources, tips and trends from the DevOps World.

Format on Save in Go with VS Code [2023]

2 years ago blog.boot.dev
Format on Save in Go with VS Code [2023]

Summary: This is a summary of an article originally published by the source. Read the full original article here →

Curated backend podcasts, videos and articles. If you're looking to become a backend developer, or just stay up-to-date with the latest backend technologies and trends, you found the right place. Subscribe below to get a copy of our newsletter, The Boot.dev Beat, each month in your inbox.

Setting up your VS Code environment to enforce the standard linting and formatting rules can save you a ton of time.

I use the following settings: { // format all files on save if a formatter is available "editor.formatOnSave": true, // I use "goimports" instead of "gofmt" // because it does the same thing but also formats imports "go.formatTool": "goimports", // go-specific settings "[go]": {"editor.formatOnSave": true, "editor.codeActionsOnSave": {"source.organizeImports": true }}, "[go.mod]": {"editor.formatOnSave": true, "editor.codeActionsOnSave": {"source.organizeImports": true }}, }

Made with pure grit © 2024 Jetpack Labs Inc. All rights reserved. www.jetpacklabs.com