Skip to content

Commit

Permalink
0.4.6 staticcheck
Browse files Browse the repository at this point in the history
  • Loading branch information
mgyucht committed Oct 23, 2023
1 parent f9474fa commit a84080d
Show file tree
Hide file tree
Showing 18 changed files with 93 additions and 93 deletions.
6 changes: 3 additions & 3 deletions .codegen/api.go.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ func (a *{{.Service.Name}}API) {{.PascalName}}(ctx context.Context{{if .Request}
getItems,
{{if .Pagination.MultiRequest}}getNextReq{{else}}nil{{end}})
{{ if .NeedsOffsetDedupe -}}
dedupedIterator := listing.NewDedupeIterator[{{ template "type" .Pagination.Entity }}, {{ template "type" .IdentifierField.Entity }}](
dedupedIterator := listing.NewDedupeIterator(
iterator,
func(item {{ template "type" .Pagination.Entity }}) {{ template "type" .IdentifierField.Entity }} {
return item{{ template "field-path" .IdFieldPath }}
Expand All @@ -222,9 +222,9 @@ func (a *{{.Service.Name}}API) {{.PascalName}}(ctx context.Context{{if .Request}
func (a *{{.Service.Name}}API) {{.PascalName}}All(ctx context.Context{{if .Request}}, request {{.Request.PascalName}}{{end}}) ([]{{ template "type" .Pagination.Entity }}, error) {
iterator := a.{{.PascalName}}(ctx{{if .Request}}, request{{end}})
{{ if .Pagination.Limit -}}
return listing.ToSliceN[{{ template "type" .Pagination.Entity }}, {{ template "type" .Pagination.Limit.Entity }}](ctx, iterator, request.{{.Pagination.Limit.PascalName}})
return listing.ToSliceN(ctx, iterator, request.{{.Pagination.Limit.PascalName}})
{{ else -}}
return listing.ToSlice[{{ template "type" .Pagination.Entity }}](ctx, iterator)
return listing.ToSlice(ctx, iterator)
{{- end }}
}
{{end}}{{if .NamedIdMap}}
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ fmt:

lint: vendor
@echo "✓ Linting source code with https://staticcheck.io/ ..."
@go run honnef.co/go/tools/cmd/staticcheck@v0.4.0 ./...
@go run honnef.co/go/tools/cmd/staticcheck@v0.4.6 ./...

test: lint
@echo "✓ Running tests ..."
Expand Down
4 changes: 2 additions & 2 deletions service/billing/api.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

30 changes: 15 additions & 15 deletions service/catalog/api.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 8 additions & 8 deletions service/compute/api.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion service/files/api.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 7 additions & 7 deletions service/iam/api.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions service/iam/model.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions service/jobs/api.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit a84080d

Please sign in to comment.