splunk / terraform-provider-splunk

Terraform Provider for Splunk
Mozilla Public License 2.0
104 stars 78 forks source link

Add linting action & fix linting errors #30

Closed zscholl closed 3 years ago

zscholl commented 3 years ago

Adds a golangci-lint action and fixes linting errors.

Kind of a rough first go at the linting fixes, feel free to shame me for any that seem unreasonable 😅

zscholl commented 3 years ago

Really strange, can't figure out why changing the error line messes with the index tests

zscholl commented 3 years ago

Really strange, can't figure out why changing the error line messes with the index tests

A peek at the Errorf docs revealed you should only be using %v or %w on error types: https://golang.org/pkg/fmt/#Errorf

anushjay commented 3 years ago

@zscholl Nice! Thanks for adding the lint and workflows, appreciate it. I've only used golint but golangci-lint looks more recent. Should I merge this after you're done with #29?

zscholl commented 3 years ago

Yeah that would be great! golangci-lint runs a bunch of linters internally, golint maybe even one of them.

It catches a lot of useful stuff so I think it would be nice to have here :)

anushjay commented 3 years ago

@zscholl resolved conflicts and merging this now. I will create a release branch soon. Thanks again for your contributions!