From 17ef08aa581d0a1f96f750824a78b1de5e6d0be2 Mon Sep 17 00:00:00 2001 From: bbedward Date: Fri, 13 Mar 2026 12:03:42 -0400 Subject: [PATCH] nix: fix go regex matching --- flake.nix | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/flake.nix b/flake.nix index 404f2d15..a8a05339 100644 --- a/flake.nix +++ b/flake.nix @@ -20,7 +20,10 @@ goModVersion = let content = builtins.readFile ./core/go.mod; - matched = builtins.match ".*\ngo ([0-9]+)\.([0-9]+).*" content; + lines = builtins.filter builtins.isString (builtins.split "\n" content); + goLines = builtins.filter (l: builtins.match "go [0-9]+\\..*" l != null) lines; + matched = + if goLines != [ ] then builtins.match "go ([0-9]+)\\.([0-9]+).*" (builtins.head goLines) else null; in if matched != null then {