Dan Anglin
71d62ecaf6
Add golangci-lint for linting and refactor the code based on the feedback from running it. Changes: - Add configuration for golangci-lint. - Break the large function in create.go into smaller ones. - Rename internal/templateFuncs to internal/templatefuncs to remove upper case letters in the package name. - Add a mage target for lint tests.
11 lines
283 B
Go
11 lines
283 B
Go
package templatefuncs
|
|
|
|
// Location returns a string with both the location and the
|
|
// location type if the location type is not empty.
|
|
func Location(location, locationType string) string {
|
|
if locationType != "" {
|
|
return location + " (" + locationType + ")"
|
|
}
|
|
|
|
return location
|
|
}
|