Skip to content

Commit d1701af

Browse files
committed
all around
1 parent 5949f81 commit d1701af

File tree

10 files changed

+35
-28
lines changed

10 files changed

+35
-28
lines changed

.golangci.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ linters:
2424
enable-all: true
2525
disable:
2626
- exportloopref # deprecated
27-
- execinquery # deprecated
2827
- exhaustruct # TODO: reconsider
2928
- depguard # TODO: reconsider
3029
- funlen # TODO: reconsider
@@ -37,7 +36,6 @@ linters:
3736
- godox
3837
- godot
3938
- gochecknoglobals
40-
- gomnd
4139
- mnd
4240

4341
issues:

Makefile

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
SHELL := /usr/bin/env bash
22

3+
## https://www.gnu.org/software/make/manual/html_node/Parallel-Disable.html
34
.NOTPARALLEL:
4-
.SECONDEXPANSION:
5-
## NOTINTERMEDIATE requires make >=4.4
6-
.NOTINTERMEDIATE:
75

86
include $(CURDIR)/scripts/go.mk
97
include $(CURDIR)/scripts/docker.mk

build/build.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ package build
44
//
55
//nolint:gochecknoglobals
66
var (
7-
Version = ""
7+
Version = "0.0.1"
88
Branch = ""
99
Commit = ""
1010
CommitShort = ""

build/docker/Dockerfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
# syntax=docker/dockerfile:1.10
1+
# syntax=docker/dockerfile:1.12
22
### https://hub.docker.com/r/docker/dockerfile
33

44
# https://docs.docker.com/build/guide/mounts/
55

66
# https://hub.docker.com/_/golang
7-
FROM --platform=$BUILDPLATFORM golang:1.23.2-alpine3.20 AS builder
7+
FROM --platform=$BUILDPLATFORM golang:1.23.4-alpine3.21 AS builder
88
RUN apk update && apk add --no-cache make git bash ca-certificates
99
WORKDIR /app
1010
ARG TARGETOS TARGETARCH
@@ -15,7 +15,7 @@ RUN --mount=type=bind,target=. \
1515

1616
#FROM scratch
1717
#COPY --from=builder /etc/ssl/certs/ /etc/ssl/certs
18-
FROM alpine:3.20
18+
FROM alpine:3.21
1919
RUN apk add --no-cache ca-certificates
2020
WORKDIR /app
2121
COPY --from=builder /tmp/out/* /app/

build/docker/debug.Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
# syntax=docker/dockerfile:1.10
1+
# syntax=docker/dockerfile:1.12
22
### https://hub.docker.com/r/docker/dockerfile
33

44
# https://hub.docker.com/_/golang
5-
FROM golang:1.23.2-alpine3.20
5+
FROM golang:1.23.4-alpine3.21
66

77
WORKDIR /wd
88

File renamed without changes.

docs/makefile_targets.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
| `cmd.<cmd dir name>` | Builds a specific cmd directory `<directory name>` and outputs the binary into `./output` folder using this pattern: `./cmd/<directory name> -> ./output/<directory name>`.
1212
| `dbg.<cmd dir name>` | Builds a specific cmd directory `<directory name>` (keeping debug symbols) and outputs the binary into `./output` folder using this pattern: `./cmd/<directory name> -> ./output/<directory name>`.
1313
| `clean` | Deletes `./output` folder.
14-
| `compose-up` | Deploys (rebuilds and recreates) the docker compose file `deployments/compose/docker-compose.yml` in attached mode. This docker compose file is intended for local development.<br>It uses the docker file `build/docker/debug.Dockerfile` and runs `air` target (see below), including hot-reload (rebuild on changes) and debug server.
15-
| `compose-down` | Stops (if started) the containers specified by the docker compose file `deployments/compose/docker-compose.yml` removes containers, cleans up the volumes and delete local docker images.
14+
| `compose-up` | Deploys (rebuilds and recreates) the docker compose file `deployments/compose.local.yml` in attached mode. This docker compose file is intended for local development.<br>It uses the docker file `build/docker/debug.Dockerfile` and runs `air` target (see below), including hot-reload (rebuild on changes) and debug server.
15+
| `compose-down` | Stops (if started) the containers specified by the docker compose file `deployments/compose.local.yml` removes containers, cleans up the volumes and delete local docker images.
1616
| `air` | Installs (if needed) [air](https://github.com/air-verse/air) under `TOOLS_BIN` folder (default is `./.tools/bin`) and runs `air -c .air.toml`.<br>Air watches for code file changes and rebuilds the binary according to the configuration `.air.toml`.<br>Current air configuration executes `cmd.goboilerplate` target (on each file change) and then runs the `./build/dlv` that starts the debug server (`dlv exec`) with the produced binary.
1717
| `build-image` | Builds the docker image using the docker file `./build/docker/Dockerfile`.<br>This docker file is intended to be used as a production image.<br>Image name and tag are specified by `IMAGE_NAME` and `IMAGE_TAG`. Default values can be overwritten during execution (eg `make IMAGE_NAME=myimage IMAGE_TAG=1.0.0 image`).
1818
| `test` | Runs go [test](https://pkg.go.dev/cmd/go/internal/test) with race conditions and prints cover report.

scripts/docker.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ build-image:
2424
--output='$(DOCKER_BUILD_OUTPUT)' \
2525
.
2626

27-
DOCKER_COMPOSE_EXEC ?= $(DOCKER_EXEC) compose -f $(CURDIR)/deployments/local/docker-compose.yml
27+
DOCKER_COMPOSE_EXEC ?= $(DOCKER_EXEC) compose -f $(CURDIR)/deployments/compose.local.yml
2828

2929
.PHONY: compose-up
3030
compose-up:

scripts/go.mk

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,17 @@
11
GO_EXEC ?= go
22
export GO_EXEC
33

4+
REPO_GIT_BRANCH = $(shell git rev-parse --abbrev-ref HEAD 2>/dev/null || true)
5+
REPO_GIT_COMMIT = $(shell git rev-parse HEAD 2>/dev/null || true)
6+
REPO_GIT_COMMIT_SHORT = $(shell git rev-parse --short HEAD 2>/dev/null || true)
7+
REPO_GIT_TAG = $(shell git describe --tags 2>/dev/null || true)
8+
49
MODULE := $(shell cat go.mod | grep -e "^module" | sed "s/^module //")
5-
VERSION ?= 0.0.0
610
X_FLAGS = \
7-
-X '$(MODULE)/build.Version=$(VERSION)' \
8-
-X '$(MODULE)/build.Branch=$(shell git rev-parse --abbrev-ref HEAD 2>/dev/null || true)' \
9-
-X '$(MODULE)/build.Commit=$(shell git rev-parse HEAD 2>/dev/null || true)' \
10-
-X '$(MODULE)/build.CommitShort=$(shell git rev-parse --short HEAD 2>/dev/null || true)' \
11-
-X '$(MODULE)/build.Tag=$(shell git describe --tags 2>/dev/null || true)'
11+
-X '$(MODULE)/build.Branch=$(REPO_GIT_BRANCH)' \
12+
-X '$(MODULE)/build.Commit=$(REPO_GIT_COMMIT)' \
13+
-X '$(MODULE)/build.CommitShort=$(REPO_GIT_COMMIT_SHORT)' \
14+
-X '$(MODULE)/build.Tag=$(REPO_GIT_TAG)'
1215

1316
GO_PACKAGES = $(GO_EXEC) list -tags='$(TAGS)' -mod=vendor ./...
1417
GO_FOLDERS = $(GO_EXEC) list -tags='$(TAGS)' -mod=vendor -f '{{ .Dir }}' ./...

scripts/tools.mk

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
## https://www.gnu.org/software/make/manual/html_node/Secondary-Expansion.html
2+
## in order for
3+
#.SECONDEXPANSION:
4+
5+
## https://www.gnu.org/software/make/manual/html_node/Special-Targets.html#index-not-intermediate-targets_002c-explicit
6+
## NOTINTERMEDIATE requires make >=4.4
7+
.NOTINTERMEDIATE:
8+
19
# https://www.gnu.org/software/make/manual/make.html#Automatic-Variables
210
# https://www.gnu.org/software/make/manual/make.html#Prerequisite-Types
311

@@ -58,7 +66,7 @@ staticcheck: $(TOOLS_BIN)/staticcheck
5866
## <golangci-lint>
5967
# https://github.com/golangci/golangci-lint/releases
6068
GOLANGCI-LINT_CMD:=github.com/golangci/golangci-lint/cmd/golangci-lint
61-
GOLANGCI-LINT_VER:=v1.61.0
69+
GOLANGCI-LINT_VER:=v1.62.2
6270
$(TOOLS_BIN)/golangci-lint: $(TOOLS_DB)/golangci-lint.$(GOLANGCI-LINT_VER).$(GO_VER).ver
6371
@curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(TOOLS_BIN) $(GOLANGCI-LINT_VER)
6472

@@ -76,7 +84,7 @@ golangci-lint-github-actions: $(TOOLS_BIN)/golangci-lint
7684
## <goimports>
7785
# https://pkg.go.dev/golang.org/x/tools?tab=versions
7886
GOIMPORTS_CMD := golang.org/x/tools/cmd/goimports
79-
GOIMPORTS_VER := v0.26.0
87+
GOIMPORTS_VER := v0.28.0
8088
$(TOOLS_BIN)/goimports: $(TOOLS_DB)/goimports.$(GOIMPORTS_VER).$(GO_VER).ver
8189
$(call go_install,goimports,$(GOIMPORTS_CMD),$(GOIMPORTS_VER))
8290

@@ -118,7 +126,7 @@ gofmt.display:
118126
## <gojq>
119127
# https://github.com/itchyny/gojq/releases
120128
GOJQ_CMD := github.com/itchyny/gojq/cmd/gojq
121-
GOJQ_VER := v0.12.16
129+
GOJQ_VER := v0.12.17
122130
$(TOOLS_BIN)/gojq: $(TOOLS_DB)/gojq.$(GOJQ_VER).$(GO_VER).ver
123131
$(call go_install,gojq,$(GOJQ_CMD),$(GOJQ_VER))
124132

@@ -129,7 +137,7 @@ gojq: $(TOOLS_BIN)/gojq
129137
## <air>
130138
# https://github.com/air-verse/air/releases
131139
AIR_CMD:=github.com/air-verse/air
132-
AIR_VER:=v1.61.0
140+
AIR_VER:=v1.61.5
133141
$(TOOLS_BIN)/air: $(TOOLS_DB)/air.$(AIR_VER).$(GO_VER).ver
134142
$(call go_install,air,$(AIR_CMD),$(AIR_VER))
135143

@@ -141,7 +149,7 @@ air: $(TOOLS_BIN)/air
141149
## <mockery>
142150
# https://github.com/vektra/mockery/releases
143151
MOCKERY_CMD:=github.com/vektra/mockery/v2
144-
MOCKERY_VER:=v2.46.2
152+
MOCKERY_VER:=v2.50.1
145153
$(TOOLS_BIN)/mockery: $(TOOLS_DB)/mockery.$(MOCKERY_VER).$(GO_VER).ver
146154
$(call go_install,air,$(MOCKERY_CMD),$(MOCKERY_VER))
147155

@@ -153,13 +161,13 @@ mockery: $(TOOLS_BIN)/mockery
153161

154162
## <protobuf>
155163
# https://github.com/protocolbuffers/protobuf/releases
156-
PROTOC_VER:=v28.2
164+
PROTOC_VER:=v29.2
157165
$(TOOLS_BIN)/protoc: $(TOOLS_DB)/protoc.$(PROTOC_VER).ver
158166
./scripts/install-protoc --version $(PROTOC_VER) --destination $(TOOLS_DIR)
159167

160168
# https://github.com/protocolbuffers/protobuf-go/releases
161169
PROTOC-GEN-GO_CMD:=google.golang.org/protobuf/cmd/protoc-gen-go
162-
PROTOC-GEN-GO_VER:=v1.35.1
170+
PROTOC-GEN-GO_VER:=v1.36.1
163171
$(TOOLS_BIN)/protoc-gen-go: $(TOOLS_DB)/protoc-gen-go.$(PROTOC-GEN-GO_VER).$(GO_VER).ver
164172
$(call go_install,protoc-gen-go,$(PROTOC-GEN-GO_CMD),$(PROTOC-GEN-GO_VER))
165173

@@ -172,7 +180,7 @@ proto: $(TOOLS_BIN)/protoc $(TOOLS_BIN)/protoc-gen-go
172180
## <shfmt>
173181
# https://github.com/mvdan/sh/releases
174182
SHFMT_CMD := mvdan.cc/sh/v3/cmd/shfmt
175-
SHFMT_VER := v3.9.0
183+
SHFMT_VER := v3.10.0
176184
$(TOOLS_BIN)/shfmt: $(TOOLS_DB)/shfmt.$(SHFMT_VER).$(GO_VER).ver
177185
$(call go_install,shfmt,$(SHFMT_CMD),$(SHFMT_VER))
178186

0 commit comments

Comments
 (0)