Add linter config and Dockerfile

This commit is contained in:
2026-05-26 17:21:02 +03:00
parent 4f2d899130
commit 12f4af12e6
2 changed files with 57 additions and 0 deletions

44
.golangci.yml Normal file
View File

@@ -0,0 +1,44 @@
version: "2"
run:
tests: false
linters:
default: all
disable:
- revive
- noinlineerr
- mnd
- tagliatelle
- ireturn
- godox
- exhaustruct
- depguard
settings:
wsl_v5:
allow-first-in-block: true
allow-whole-block: false
branch-max-lines: 2
lll:
line-length: 120
staticcheck:
checks:
- -SA1029
varnamelen:
ignore-decls:
- tx *sqlx.Tx
wrapcheck:
ignore-sig-regexps:
- \.Write\(
- \.WriteString\(
- \.WriteJSON\(
- \.WriteHTML\(
- \.Redirect\(
- \.Error\(
- \.ErrorV0\(
issues:
max-issues-per-linter: 0
max-same-issues: 0
formatters:
enable:
- gofmt
- gofumpt
- goimports

13
Dockerfile Normal file
View File

@@ -0,0 +1,13 @@
FROM golang:alpine AS builder
LABEL maintainer="vladimir@hodakov.me"
COPY . /src
RUN cd /src && go build ./cmd/deconnect
FROM docker.io/alpine
COPY --from=builder /src/deconnect /bin/deconnect
VOLUME /etc/deconnect.yaml
ENTRYPOINT [ "/bin/deconnect" ]