Skip to content
Merged
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
21 changes: 12 additions & 9 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,26 +12,29 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout source
uses: actions/checkout@v3
- name: Setup Golang
uses: actions/setup-go@v3
uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: stable
- name: Get dependencies
run: go get -v -t -d ./...
run: make ensure_deps
- name: Build
run: go build -v
run: make build
- name: Test
run: go test -v -race ./...
run: make test

lint:
name: Lint
runs-on: ubuntu-latest
steps:
- name: Checkout source
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: stable
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
uses: golangci/golangci-lint-action@v7
with:
version: latest
args: --timeout=5m
52 changes: 21 additions & 31 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -1,43 +1,33 @@
linters:
disable:
# Removed deprecated linters
# - deadcode
# - structcheck
# - varcheck
# - golint
version: "2"

linters:
enable:
# Default linters
- errcheck
- gosimple
- govet
- ineffassign
- staticcheck
- typecheck
- unused

# Optional ones we want to include
- gochecknoglobals
- gochecknoinits
- goconst
- gocritic
- goimports
- revive
- gosec
- misspell
- nakedret
- revive
- unconvert
- unparam
settings:
govet:
enable:
- shadow
misspell:
locale: US
exclusions:
presets:
- comments
- common-false-positives
- std-error-handling

linters-settings:
goimports:
local-prefixes: github.com/kunwardeep/paralleltest
misspell:
local: US
ignore-words:

govet:
shadow: true

output:
formats: colored-line-number
formatters:
enable:
- goimports
settings:
goimports:
local-prefixes:
- github.com/kunwardeep/paralleltest
13 changes: 2 additions & 11 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,24 +1,15 @@
export GOSUMDB := off
export GOFLAGS := -v -mod=vendor
GOLANGCI_VERSION := latest

default: build

build:
go build "$(MAIN_PKG)"
go build -v .

ensure_deps:
go mod tidy
go mod vendor
cd tools && go mod tidy
cd tools && go mod vendor

# GOFLAGS=-mod=mod: This ensures Go resolves dependencies via the go.mod file
install_devtools:
GOFLAGS=-mod=mod go install github.com/golangci/golangci-lint/cmd/golangci-lint@$(GOLANGCI_VERSION)

clean:
go clean $(MAIN_PKG)
go install github.com/golangci/golangci-lint/v2/cmd/golangci-lint@$(GOLANGCI_VERSION)

lint:
golangci-lint run ./...
Expand Down
105 changes: 0 additions & 105 deletions tools/go.mod

This file was deleted.

Loading