{"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 class=\"wp-block-paragraph\">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 class=\"wp-block-paragraph\">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 class=\"wp-block-paragraph\">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\" decoding=\"async\" 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=\"auto, (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":{"footnotes":""},"categories":[235],"tags":[231,232,266],"class_list":["post-2292","post","type-post","status-publish","format-standard","hentry","category-programming","tag-go","tag-golang","tag-programming","entry"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v28.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Running `go fmt`, `goimports` and `golangci-lint` on save with GoLand &#8211; 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 &#8211; 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\t<meta property=\"og:image:width\" content=\"2252\" \/>\n\t<meta property=\"og:image:height\" content=\"1620\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Mathias Beke\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@MthsBk\" \/>\n<meta name=\"twitter:site\" content=\"@MthsBk\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Mathias Beke\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/denbeke.be\\\/blog\\\/programming\\\/running-go-fmt-goimports-and-golangci-lint-on-save-with-goland\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/denbeke.be\\\/blog\\\/programming\\\/running-go-fmt-goimports-and-golangci-lint-on-save-with-goland\\\/\"},\"author\":{\"name\":\"Mathias Beke\",\"@id\":\"https:\\\/\\\/denbeke.be\\\/blog\\\/#\\\/schema\\\/person\\\/386878f712fe3fe22227216f087772dc\"},\"headline\":\"Running `go fmt`, `goimports` and `golangci-lint` on save with GoLand\",\"datePublished\":\"2019-09-04T20:14:22+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/denbeke.be\\\/blog\\\/programming\\\/running-go-fmt-goimports-and-golangci-lint-on-save-with-goland\\\/\"},\"wordCount\":85,\"commentCount\":0,\"image\":{\"@id\":\"https:\\\/\\\/denbeke.be\\\/blog\\\/programming\\\/running-go-fmt-goimports-and-golangci-lint-on-save-with-goland\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/denbeke.be\\\/blog\\\/wp-content\\\/uploads\\\/2019\\\/09\\\/go-fmt-goimports-go-lint-in-GoLand-editor.png\",\"keywords\":[\"go\",\"golang\",\"programming\"],\"articleSection\":[\"programming\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/denbeke.be\\\/blog\\\/programming\\\/running-go-fmt-goimports-and-golangci-lint-on-save-with-goland\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/denbeke.be\\\/blog\\\/programming\\\/running-go-fmt-goimports-and-golangci-lint-on-save-with-goland\\\/\",\"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 &#8211; 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\"},\"image\":{\"@id\":\"https:\\\/\\\/denbeke.be\\\/blog\\\/programming\\\/running-go-fmt-goimports-and-golangci-lint-on-save-with-goland\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/denbeke.be\\\/blog\\\/wp-content\\\/uploads\\\/2019\\\/09\\\/go-fmt-goimports-go-lint-in-GoLand-editor.png\",\"datePublished\":\"2019-09-04T20:14:22+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/denbeke.be\\\/blog\\\/#\\\/schema\\\/person\\\/386878f712fe3fe22227216f087772dc\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/denbeke.be\\\/blog\\\/programming\\\/running-go-fmt-goimports-and-golangci-lint-on-save-with-goland\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/denbeke.be\\\/blog\\\/programming\\\/running-go-fmt-goimports-and-golangci-lint-on-save-with-goland\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/denbeke.be\\\/blog\\\/programming\\\/running-go-fmt-goimports-and-golangci-lint-on-save-with-goland\\\/#primaryimage\",\"url\":\"https:\\\/\\\/denbeke.be\\\/blog\\\/wp-content\\\/uploads\\\/2019\\\/09\\\/go-fmt-goimports-go-lint-in-GoLand-editor.png\",\"contentUrl\":\"https:\\\/\\\/denbeke.be\\\/blog\\\/wp-content\\\/uploads\\\/2019\\\/09\\\/go-fmt-goimports-go-lint-in-GoLand-editor.png\",\"width\":2252,\"height\":1620},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/denbeke.be\\\/blog\\\/programming\\\/running-go-fmt-goimports-and-golangci-lint-on-save-with-goland\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/denbeke.be\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Running `go fmt`, `goimports` and `golangci-lint` on save with GoLand\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/denbeke.be\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/denbeke.be\\\/blog\\\/\",\"name\":\"DenBeke\",\"description\":\"Mathias Beke\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/denbeke.be\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/denbeke.be\\\/blog\\\/#\\\/schema\\\/person\\\/386878f712fe3fe22227216f087772dc\",\"name\":\"Mathias Beke\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/8889cf00cef9570a8f82e7510ed97205ccb7a1a0d2c7e0968a07e1885386f198?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/8889cf00cef9570a8f82e7510ed97205ccb7a1a0d2c7e0968a07e1885386f198?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/8889cf00cef9570a8f82e7510ed97205ccb7a1a0d2c7e0968a07e1885386f198?s=96&d=mm&r=g\",\"caption\":\"Mathias Beke\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Running `go fmt`, `goimports` and `golangci-lint` on save with GoLand &#8211; DenBeke","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/denbeke.be\/blog\/programming\/running-go-fmt-goimports-and-golangci-lint-on-save-with-goland\/","og_locale":"en_US","og_type":"article","og_title":"Running `go fmt`, `goimports` and `golangci-lint` on save with GoLand &#8211; DenBeke","og_description":"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;]","og_url":"https:\/\/denbeke.be\/blog\/programming\/running-go-fmt-goimports-and-golangci-lint-on-save-with-goland\/","og_site_name":"DenBeke","article_published_time":"2019-09-04T20:14:22+00:00","og_image":[{"width":2252,"height":1620,"url":"https:\/\/denbeke.be\/blog\/wp-content\/uploads\/2019\/09\/go-fmt-goimports-go-lint-in-GoLand-editor.png","type":"image\/png"}],"author":"Mathias Beke","twitter_card":"summary_large_image","twitter_creator":"@MthsBk","twitter_site":"@MthsBk","twitter_misc":{"Written by":"Mathias Beke"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/denbeke.be\/blog\/programming\/running-go-fmt-goimports-and-golangci-lint-on-save-with-goland\/#article","isPartOf":{"@id":"https:\/\/denbeke.be\/blog\/programming\/running-go-fmt-goimports-and-golangci-lint-on-save-with-goland\/"},"author":{"name":"Mathias Beke","@id":"https:\/\/denbeke.be\/blog\/#\/schema\/person\/386878f712fe3fe22227216f087772dc"},"headline":"Running `go fmt`, `goimports` and `golangci-lint` on save with GoLand","datePublished":"2019-09-04T20:14:22+00:00","mainEntityOfPage":{"@id":"https:\/\/denbeke.be\/blog\/programming\/running-go-fmt-goimports-and-golangci-lint-on-save-with-goland\/"},"wordCount":85,"commentCount":0,"image":{"@id":"https:\/\/denbeke.be\/blog\/programming\/running-go-fmt-goimports-and-golangci-lint-on-save-with-goland\/#primaryimage"},"thumbnailUrl":"https:\/\/denbeke.be\/blog\/wp-content\/uploads\/2019\/09\/go-fmt-goimports-go-lint-in-GoLand-editor.png","keywords":["go","golang","programming"],"articleSection":["programming"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/denbeke.be\/blog\/programming\/running-go-fmt-goimports-and-golangci-lint-on-save-with-goland\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/denbeke.be\/blog\/programming\/running-go-fmt-goimports-and-golangci-lint-on-save-with-goland\/","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 &#8211; 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"},"image":{"@id":"https:\/\/denbeke.be\/blog\/programming\/running-go-fmt-goimports-and-golangci-lint-on-save-with-goland\/#primaryimage"},"thumbnailUrl":"https:\/\/denbeke.be\/blog\/wp-content\/uploads\/2019\/09\/go-fmt-goimports-go-lint-in-GoLand-editor.png","datePublished":"2019-09-04T20:14:22+00:00","author":{"@id":"https:\/\/denbeke.be\/blog\/#\/schema\/person\/386878f712fe3fe22227216f087772dc"},"breadcrumb":{"@id":"https:\/\/denbeke.be\/blog\/programming\/running-go-fmt-goimports-and-golangci-lint-on-save-with-goland\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/denbeke.be\/blog\/programming\/running-go-fmt-goimports-and-golangci-lint-on-save-with-goland\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/denbeke.be\/blog\/programming\/running-go-fmt-goimports-and-golangci-lint-on-save-with-goland\/#primaryimage","url":"https:\/\/denbeke.be\/blog\/wp-content\/uploads\/2019\/09\/go-fmt-goimports-go-lint-in-GoLand-editor.png","contentUrl":"https:\/\/denbeke.be\/blog\/wp-content\/uploads\/2019\/09\/go-fmt-goimports-go-lint-in-GoLand-editor.png","width":2252,"height":1620},{"@type":"BreadcrumbList","@id":"https:\/\/denbeke.be\/blog\/programming\/running-go-fmt-goimports-and-golangci-lint-on-save-with-goland\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/denbeke.be\/blog\/"},{"@type":"ListItem","position":2,"name":"Running `go fmt`, `goimports` and `golangci-lint` on save with GoLand"}]},{"@type":"WebSite","@id":"https:\/\/denbeke.be\/blog\/#website","url":"https:\/\/denbeke.be\/blog\/","name":"DenBeke","description":"Mathias Beke","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/denbeke.be\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/denbeke.be\/blog\/#\/schema\/person\/386878f712fe3fe22227216f087772dc","name":"Mathias Beke","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/8889cf00cef9570a8f82e7510ed97205ccb7a1a0d2c7e0968a07e1885386f198?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/8889cf00cef9570a8f82e7510ed97205ccb7a1a0d2c7e0968a07e1885386f198?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/8889cf00cef9570a8f82e7510ed97205ccb7a1a0d2c7e0968a07e1885386f198?s=96&d=mm&r=g","caption":"Mathias Beke"}}]}},"_links":{"self":[{"href":"https:\/\/denbeke.be\/blog\/wp-json\/wp\/v2\/posts\/2292","targetHints":{"allow":["GET"]}}],"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}]}}