From 30b4db86f9d9c446e9fe63c558f5cf0ea9460c35 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dan=20Gr=C3=B8ndahl?= Date: Thu, 4 Jun 2026 09:16:47 +0200 Subject: [PATCH] ci(lint): forbid endian-unsafe patterns via golangci-lint Enable forbidigo with rules blocking binary.NativeEndian and unsafe.Pointer, both of which are byte-order sensitive and would silently break on the s390x build target (big-endian). The codebase currently has zero usages; this is a guardrail against regressions. --- .golangci.yml | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 .golangci.yml diff --git a/.golangci.yml b/.golangci.yml new file mode 100644 index 000000000..cd76c1842 --- /dev/null +++ b/.golangci.yml @@ -0,0 +1,13 @@ +version: "2" + +linters: + enable: + - forbidigo + settings: + forbidigo: + analyze-types: true + forbid: + - pattern: '^binary\.NativeEndian$' + msg: "binary.NativeEndian is not portable; s390x is big-endian. Use binary.BigEndian or binary.LittleEndian explicitly." + - pattern: '^unsafe\.Pointer$' + msg: "unsafe.Pointer byte reinterpretation is endian-sensitive on s390x. Prefer encoding/binary, or add //nolint:forbidigo with justification."