From ec14f6ceda63183987deb328686f85ad3194e7b0 Mon Sep 17 00:00:00 2001 From: Michael Yang Date: Sat, 11 May 2024 14:12:36 -0700 Subject: [PATCH] case sensitive filepaths (#4366) --- types/model/name.go | 8 +++----- types/model/name_test.go | 4 ++-- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/types/model/name.go b/types/model/name.go index b79374c3..f32b2596 100644 --- a/types/model/name.go +++ b/types/model/name.go @@ -291,11 +291,9 @@ func (n Name) Filepath() string { panic("illegal attempt to get filepath of invalid name") } return filepath.Join( - strings.ToLower(filepath.Join( - n.Host, - n.Namespace, - n.Model, - )), + n.Host, + n.Namespace, + n.Model, n.Tag, ) } diff --git a/types/model/name_test.go b/types/model/name_test.go index fb584291..27a8ccf8 100644 --- a/types/model/name_test.go +++ b/types/model/name_test.go @@ -276,9 +276,9 @@ func TestFilepathAllocs(t *testing.T) { allocs := testing.AllocsPerRun(1000, func() { n.Filepath() }) - var allowedAllocs float64 = 3 + var allowedAllocs float64 = 1 if runtime.GOOS == "windows" { - allowedAllocs = 5 + allowedAllocs = 3 } if allocs > allowedAllocs { t.Errorf("allocs = %v; allowed %v", allocs, allowedAllocs)