golangci-lint icon indicating copy to clipboard operation
golangci-lint copied to clipboard

Printing out SuggestedFixes

Open SVilgelm opened this issue 3 years ago • 7 comments

output:

pkg/cmd/register/routes.go:40:12: fieldalignment: struct with 32 pointer bytes could be 16 (govet)
type route struct {
           ^
Rearrange fields
struct {
        HTTPMethods map[string]*httpMethod `json:"httpMethods"`
        Route       string                 `json:"route"`
        Streamable  bool                   `json:"isStreamable,omitempty"`
        AdminOnly   bool                   `json:"isAdminOnlyAccess,omitempty"`
        APIOnly     bool                   `json:"apiOnlyAccess,omitempty"`
}

SVilgelm avatar Feb 25 '21 16:02 SVilgelm

I still don't understand how to use the SuggestedFixes properly, but I want to print them out, at least.

SVilgelm avatar Feb 25 '21 16:02 SVilgelm

I'm also working on :wink:

I'm able to apply the fixes.

ldez avatar Feb 25 '21 16:02 ldez

Maybe you can open an issue?

related to https://github.com/golangci/golangci-lint/issues/1322

ldez avatar Feb 25 '21 16:02 ldez

I created an issue: #1779

ldez avatar Feb 25 '21 18:02 ldez

@ldez actually I need this for govet, otherwise it's unclear what to do :)) I will keep it open for some time, then will close (when the autofix works)

SVilgelm avatar Feb 25 '21 20:02 SVilgelm

some screen shots:

Screen Shot 2021-02-25 at 1 59 01 PM Screen Shot 2021-02-25 at 2 18 59 PM Screen Shot 2021-02-25 at 2 21 10 PM

nlreturn removes the lines, that's why there are empty lines

SVilgelm avatar Feb 25 '21 20:02 SVilgelm

CLA assistant check
All committers have signed the CLA.

CLAassistant avatar May 19 '21 06:05 CLAassistant