{"id":2292,"date":"2019-09-04T21:14:22","date_gmt":"2019-09-04T20:14:22","guid":{"rendered":"https:\/\/denbeke.be\/blog\/?p=2292"},"modified":"2019-09-04T21:14:22","modified_gmt":"2019-09-04T20:14:22","slug":"running-go-fmt-goimports-and-golangci-lint-on-save-with-goland","status":"publish","type":"post","link":"https:\/\/denbeke.be\/blog\/programming\/running-go-fmt-goimports-and-golangci-lint-on-save-with-goland\/","title":{"rendered":"Running `go fmt`, `goimports` and `golangci-lint` on save with GoLand"},"content":{"rendered":"\n<p>Recently I started using <a href=\"https:\/\/www.jetbrains.com\/go\/\">GoLand<\/a> for Go development. This means that I\u2019m constantly adapting to this new editor and looking up how to do certain things.<\/p>\n\n\n\n<p>One of the things I really liked in Visual Studio Code was the formatting\/linting\/goimports on save. It appears that it is super simple to enable this in GoLand.<\/p>\n\n\n\n<p>Go to <em>Preferences<\/em>, <em>Tools<\/em>, <em>File Watchers<\/em>. Click on the plus sign and add the wanted Go tools there:<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" width=\"2252\" height=\"1620\" src=\"https:\/\/denbeke.be\/blog\/wp-content\/uploads\/2019\/09\/go-fmt-goimports-go-lint-in-GoLand-editor.png\" alt=\"\" class=\"wp-image-2293\" srcset=\"https:\/\/denbeke.be\/blog\/wp-content\/uploads\/2019\/09\/go-fmt-goimports-go-lint-in-GoLand-editor.png 2252w, https:\/\/denbeke.be\/blog\/wp-content\/uploads\/2019\/09\/go-fmt-goimports-go-lint-in-GoLand-editor-300x216.png 300w, https:\/\/denbeke.be\/blog\/wp-content\/uploads\/2019\/09\/go-fmt-goimports-go-lint-in-GoLand-editor-768x552.png 768w, https:\/\/denbeke.be\/blog\/wp-content\/uploads\/2019\/09\/go-fmt-goimports-go-lint-in-GoLand-editor-1024x737.png 1024w, https:\/\/denbeke.be\/blog\/wp-content\/uploads\/2019\/09\/go-fmt-goimports-go-lint-in-GoLand-editor-1568x1128.png 1568w\" sizes=\"(max-width: 2252px) 100vw, 2252px\" \/><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>Recently I started using GoLand for Go development. This means that I\u2019m constantly adapting to this new editor and looking up how to do certain things. One of the things I really liked in Visual Studio Code was the formatting\/linting\/goimports on save. It appears that it is super simple to enable this in GoLand. Go [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[235],"tags":[231,232,266],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v15.6.2 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Running `go fmt`, `goimports` and `golangci-lint` on save with GoLand &ndash; DenBeke<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/denbeke.be\/blog\/programming\/running-go-fmt-goimports-and-golangci-lint-on-save-with-goland\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Running `go fmt`, `goimports` and `golangci-lint` on save with GoLand &ndash; DenBeke\" \/>\n<meta property=\"og:description\" content=\"Recently I started using GoLand for Go development. This means that I\u2019m constantly adapting to this new editor and looking up how to do certain things. One of the things I really liked in Visual Studio Code was the formatting\/linting\/goimports on save. It appears that it is super simple to enable this in GoLand. Go [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/denbeke.be\/blog\/programming\/running-go-fmt-goimports-and-golangci-lint-on-save-with-goland\/\" \/>\n<meta property=\"og:site_name\" content=\"DenBeke\" \/>\n<meta property=\"article:published_time\" content=\"2019-09-04T20:14:22+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/denbeke.be\/blog\/wp-content\/uploads\/2019\/09\/go-fmt-goimports-go-lint-in-GoLand-editor.png\" \/>\n<meta name=\"twitter:card\" content=\"summary\" \/>\n<meta name=\"twitter:creator\" content=\"@MthsBk\" \/>\n<meta name=\"twitter:site\" content=\"@MthsBk\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebSite\",\"@id\":\"https:\/\/denbeke.be\/blog\/#website\",\"url\":\"https:\/\/denbeke.be\/blog\/\",\"name\":\"DenBeke\",\"description\":\"Mathias Beke\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":\"https:\/\/denbeke.be\/blog\/?s={search_term_string}\",\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"ImageObject\",\"@id\":\"https:\/\/denbeke.be\/blog\/programming\/running-go-fmt-goimports-and-golangci-lint-on-save-with-goland\/#primaryimage\",\"inLanguage\":\"en-US\",\"url\":\"https:\/\/denbeke.be\/blog\/wp-content\/uploads\/2019\/09\/go-fmt-goimports-go-lint-in-GoLand-editor.png\",\"width\":2252,\"height\":1620},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/denbeke.be\/blog\/programming\/running-go-fmt-goimports-and-golangci-lint-on-save-with-goland\/#webpage\",\"url\":\"https:\/\/denbeke.be\/blog\/programming\/running-go-fmt-goimports-and-golangci-lint-on-save-with-goland\/\",\"name\":\"Running `go fmt`, `goimports` and `golangci-lint` on save with GoLand &ndash; DenBeke\",\"isPartOf\":{\"@id\":\"https:\/\/denbeke.be\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/denbeke.be\/blog\/programming\/running-go-fmt-goimports-and-golangci-lint-on-save-with-goland\/#primaryimage\"},\"datePublished\":\"2019-09-04T20:14:22+00:00\",\"dateModified\":\"2019-09-04T20:14:22+00:00\",\"author\":{\"@id\":\"https:\/\/denbeke.be\/blog\/#\/schema\/person\/386878f712fe3fe22227216f087772dc\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/denbeke.be\/blog\/programming\/running-go-fmt-goimports-and-golangci-lint-on-save-with-goland\/\"]}]},{\"@type\":\"Person\",\"@id\":\"https:\/\/denbeke.be\/blog\/#\/schema\/person\/386878f712fe3fe22227216f087772dc\",\"name\":\"Mathias Beke\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\/\/denbeke.be\/blog\/#personlogo\",\"inLanguage\":\"en-US\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/015ba35e6ce4f5859e3888ca99807575?s=96&d=mm&r=g\",\"caption\":\"Mathias Beke\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","_links":{"self":[{"href":"https:\/\/denbeke.be\/blog\/wp-json\/wp\/v2\/posts\/2292"}],"collection":[{"href":"https:\/\/denbeke.be\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/denbeke.be\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/denbeke.be\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/denbeke.be\/blog\/wp-json\/wp\/v2\/comments?post=2292"}],"version-history":[{"count":1,"href":"https:\/\/denbeke.be\/blog\/wp-json\/wp\/v2\/posts\/2292\/revisions"}],"predecessor-version":[{"id":2294,"href":"https:\/\/denbeke.be\/blog\/wp-json\/wp\/v2\/posts\/2292\/revisions\/2294"}],"wp:attachment":[{"href":"https:\/\/denbeke.be\/blog\/wp-json\/wp\/v2\/media?parent=2292"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/denbeke.be\/blog\/wp-json\/wp\/v2\/categories?post=2292"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/denbeke.be\/blog\/wp-json\/wp\/v2\/tags?post=2292"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}