-
Notifications
You must be signed in to change notification settings - Fork 53
Enabled golangci-lint with staticcheck only and fixed issues #149
Enabled golangci-lint with staticcheck only and fixed issues #149
Conversation
Codecov Report
@@ Coverage Diff @@
## main #149 +/- ##
=======================================
Coverage 27.79% 27.79%
=======================================
Files 20 20
Lines 1558 1558
=======================================
Hits 433 433
Misses 1051 1051
Partials 74 74
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
pkg/server/router/dwn.go
Outdated
Manifest manifest.CredentialManifest `json:"manifest" validate:"required"` | ||
DWNResponse dwnpkg.DWNPublishManifestResponse `json:"dwnResponse" validate:"required"` | ||
Manifest *manifest.CredentialManifest `json:"manifest" validate:"required"` | ||
DWNResponse *dwnpkg.DWNPublishManifestResponse `json:"dwnResponse" validate:"required"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i'd prefer reverting this, required fields should not be nil-able
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good.
pkg/server/router/dwn.go
Outdated
@@ -79,20 +79,20 @@ func (dwnr DWNRouter) PublishManifest(ctx context.Context, w http.ResponseWriter | |||
req := request.ToServiceRequest() | |||
publishManifestResponse, err := dwnr.service.GetManifest(req) | |||
|
|||
if err != nil || &publishManifestResponse.Manifest == nil { | |||
if err != nil || publishManifestResponse.Manifest == nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
to get around this check we should define an IsEmpty
method on Manifest. I think one may even already exist.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
This PR configures and enables golangci-lint in github actions. I intentionally only enabled the
staticcheck
linter, so this becomes easier to review. The only noteworthy change to highlight was the due to the following warning:To fix, I changed this to use the
IsEmpty()
method.Additional linters will be enabled in a follow up PR.