Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ GOOS := linux
GOARCH := amd64

# Linting
GOLANGCI_LINT_VERSION := v2.2.2
GOLANGCI_LINT_VERSION := v2.12.2
Comment thread
bramwelt marked this conversation as resolved.
LINT_TIMEOUT := 10m
LINT_TOOL=$(shell go env GOPATH)/bin/golangci-lint

Expand Down Expand Up @@ -54,7 +54,7 @@ apigen: deps #@ Generate API code using Goa
.PHONY: lint
lint: ## Run golangci-lint (local Go linting)
@echo "Running golangci-lint..."
@which golangci-lint >/dev/null 2>&1 || (echo "Installing golangci-lint..." && go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest)
@which golangci-lint >/dev/null 2>&1 || (echo "Installing golangci-lint..." && go install github.com/golangci/golangci-lint/v2/cmd/golangci-lint@$(GOLANGCI_LINT_VERSION))
@golangci-lint run ./... && echo "==> Lint OK"
Comment on lines 55 to 58

.PHONY: test
Expand Down
4 changes: 1 addition & 3 deletions cmd/service/service_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -594,8 +594,6 @@ func TestQuerySvcsrvc_InterfaceCompliance(t *testing.T) {
mockOrgSearcher := mock.NewMockOrganizationSearcher()
service := NewQuerySvc(mockResourceSearcher, mockAccessChecker, mock.NewMockResourceFilter(), mockOrgSearcher, mock.NewMockAuthService())

// This will fail to compile if querySvcsrvc doesn't implement querysvc.Service
var _ querysvc.Service = service

var _ querysvc.Service = (*querySvcsrvc)(nil)
assert.NotNil(t, service)
}
5 changes: 2 additions & 3 deletions internal/service/organization_search_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -759,15 +759,14 @@ func TestOrganizationSearchInterface(t *testing.T) {
mockSearcher := mock.NewMockOrganizationSearcher()
service := NewOrganizationSearch(mockSearcher)

// Verify that the service implements the interface
var _ OrganizationSearcher = service
var _ OrganizationSearcher = (*OrganizationSearch)(nil)
assertion.NotNil(service)
})

t.Run("interface methods are callable", func(t *testing.T) {
// Setup
mockSearcher := mock.NewMockOrganizationSearcher()
var service OrganizationSearcher = NewOrganizationSearch(mockSearcher)
service := NewOrganizationSearch(mockSearcher)

ctx := context.Background()
criteria := model.OrganizationSearchCriteria{
Expand Down
2 changes: 1 addition & 1 deletion pkg/httpclient/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ func (c *Client) doRequest(ctx context.Context, reqConfig Request) (*Response, e
if err != nil {
return nil, fmt.Errorf("HTTP request failed: %w", err)
}
defer resp.Body.Close()
defer func() { _ = resp.Body.Close() }()

body, err := io.ReadAll(resp.Body)
if err != nil {
Expand Down
Loading