Skip to content

Commit

Permalink
fix: linting bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
Richard87 committed Oct 24, 2024
1 parent 7065c42 commit 4429e3a
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 0 deletions.
35 changes: 35 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
ENVIRONMENT ?= dev

CONTAINER_REPO ?= radix$(ENVIRONMENT)
DOCKER_REGISTRY ?= $(CONTAINER_REPO).azurecr.io

BINS = radix-api
IMAGES = radix-api

GIT_TAG = $(shell git describe --tags --always 2>/dev/null)
CURRENT_FOLDER = $(shell pwd)
VERSION ?= ${GIT_TAG}
IMAGE_TAG ?= ${VERSION}
LDFLAGS += -s -w

CX_OSES = linux windows
CX_ARCHS = amd64

.PHONY: build
build: $(BINS)

.PHONY: test
test:
go test -cover `go list ./...`

.PHONY: lint
lint: bootstrap
golangci-lint run --max-same-issues 0 --timeout 10m


HAS_GOLANGCI_LINT := $(shell command -v golangci-lint;)

bootstrap:
ifndef HAS_GOLANGCI_LINT
go install github.com/golangci/golangci-lint/cmd/[email protected]
endif
2 changes: 2 additions & 0 deletions main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ func TestRun(t *testing.T) {
defer server.Close()

req, err := http.NewRequest(http.MethodGet, server.URL, nil)
require.NoError(t, err)
req.Header.Add("X-Namespace", "hello-world-dev")
req.Header.Add("X-Code", "503")
regularRequest, err := http.DefaultClient.Do(req)
Expand All @@ -28,6 +29,7 @@ func TestRun(t *testing.T) {
assert.Contains(t, string(bytes), "Server error - Radix")

req, err = http.NewRequest(http.MethodGet, server.URL, nil)
require.NoError(t, err)
req.Header.Add("X-Namespace", "equinor-web-sites-dev")
req.Header.Add("X-Code", "503")
equinorRequst, err := http.DefaultClient.Do(req)
Expand Down

0 comments on commit 4429e3a

Please sign in to comment.