From 87a6bb370acc3690e89a8b0d5109fcb0dab0a374 Mon Sep 17 00:00:00 2001 From: Jakob Unterwurzacher Date: Thu, 21 Oct 2021 16:42:00 +0200 Subject: [PATCH] nametransform: fix math.MaxInt build failure on older Go Failure is: # github.com/rfjakob/gocryptfs/v2/internal/nametransform internal/nametransform/names.go:47:33: undefined: math.MaxInt math.MaxInt was only introduced in Go 1.17. Use MaxInt32 instead, which is good enough, even on amd64. It only has to be larger than any name we might encounter. --- internal/nametransform/names.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/nametransform/names.go b/internal/nametransform/names.go index 939d31e..e07ccfb 100644 --- a/internal/nametransform/names.go +++ b/internal/nametransform/names.go @@ -44,7 +44,7 @@ func New(e *eme.EMECipher, longNames bool, longNameMax uint8, raw64 bool, badnam if raw64 { b64 = base64.RawURLEncoding } - var effectiveLongNameMax int = math.MaxInt + var effectiveLongNameMax int = math.MaxInt32 if longNames { if longNameMax == 0 { effectiveLongNameMax = NameMax