feat: squash multiple modules to one

This commit is contained in:
2024-05-08 19:09:33 +03:00
parent 55719b4399
commit fef404f1a7
37 changed files with 37 additions and 491 deletions

View File

@ -1,53 +0,0 @@
.DEFAULT_GOAL := help
# ==================================================================================== #
# HELPERS
# ==================================================================================== #
## help: print this help message
.PHONY: help
help:
@echo 'Usage:'
@sed -n 's/^##//p' ${MAKEFILE_LIST} | column -t -s ':' | sed -e 's/^/ /'
## all: tidy + audit + test/cover
all: generate tidy test lint test/cover
# ==================================================================================== #
# QUALITY CONTROL
# ==================================================================================== #
## tidy: format code and tidy modfile
.PHONY: tidy
tidy:
go fmt ./...
goimports -local=$(shell cat go.mod | grep module | awk '{print $$2}')/ -w .
go mod tidy -v
## audit: run quality control checks
.PHONY: lint
lint:
go mod verify
go run github.com/golangci/golangci-lint/cmd/golangci-lint@latest run -v ./...
# ==================================================================================== #
# DEVELOPMENT
# ==================================================================================== #
## generate: run all generators
.PHONY: generate
generate:
go generate ./...
## test: run all tests
.PHONY: test
test:
go test -race -buildvcs ./...
## test/cover: run all tests and display coverage
.PHONY: test/cover
test/cover:
go test -race -buildvcs -coverprofile=/tmp/coverage.out ./...
go tool cover -html=/tmp/coverage.out

View File

@ -1,11 +0,0 @@
module worker-pool
go 1.21.6
require github.com/stretchr/testify v1.8.4
require (
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)

View File

@ -1,4 +1,4 @@
package main
package workerpool
import (
"fmt"

View File

@ -1,4 +1,4 @@
package main
package workerpool
import (
"fmt"