GoLand: File is not `goimports`-ed (goimports)

Had a bit of a head scratcher when I was linting my Go code with golangci-lint. I was getting the following error:

File is not `goimports`-ed (goimports)

After checking for formatting errors (tabs v spaces) and running fmt I found this setting in GoLand which solved the issue (it reorganizes your import section).

All you need to do is set the Sorting type to goimports and you’ll be golden.

Hugo date error

I was firing up a Gitlab Pages site using Hugo today and ran across the following error

Failed to get translated string for language "en" and ID "postedOnDate": template: :1:13: executing "" at <.Count>: can't evaluate field Count in type string

Though the magic of grep I found two locations for the offender:

/themes/beautifulhugo/i18n/ja.yaml /themes/beautifulhugo/i18n/en.yaml

You’ll find the following bit of code here

- id: postedOnDate  translation: "Posted on {{ .Count }}"

Remove Count from the setting as shown in the following snippet and you’ll be golden

- id: postedOnDate  translation: "Posted on {{ . }}"