Browse Source

case sensitive filepaths (#4366)

Michael Yang 11 months ago
parent
commit
ec14f6ceda
2 changed files with 5 additions and 7 deletions
  1. 3 5
      types/model/name.go
  2. 2 2
      types/model/name_test.go

+ 3 - 5
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,
 	)
 }

+ 2 - 2
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)