Skip to content

Flagging any method named All as SELECT *? #5

@myshkin5

Description

@myshkin5

I have some API code that's calling an All method in the DB layer and this linter is flagging it as SELECT *. The DB layer is being mocked so the flagging seems suspect. Here's the interface the API code is calling:

type WidgetDB interface {
	All(ctx context.Context) ([]tsql.Widget, error)
}

Here's the test code getting flagged (widgetDBMoq is a mock of WidgetDB):

widgetDBMoq.onCall().All(req.Context()).
	returnResults([]tsql.Widget{dbWidget1, dbWidget2}, nil)

And here's the linter output:

api/internal/widget_test.go:95:4: SQLBoiler model().All() without qm.Select() defaults to SELECT * (unqueryvet)
			widgetDBMoq.onCall().All(req.Context()).
			^

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions