diff --git a/go.mod b/go.mod index 24404b9..5b960e6 100644 --- a/go.mod +++ b/go.mod @@ -8,7 +8,7 @@ require ( github.com/goravel/cos v1.18.0 github.com/goravel/example-proto v0.0.1 github.com/goravel/fiber v1.18.1-0.20260901101548-72e06e6c5635 - github.com/goravel/framework v1.18.1-0.20260925114822-dab1968caa54 + github.com/goravel/framework v1.18.1-0.20260925125002-93850001fe6f github.com/goravel/gemini v1.18.0 github.com/goravel/gin v1.18.1-0.20260926005436-467f03c48058 github.com/goravel/inertia v1.18.1-0.20260824090129-ac3d472d028c @@ -264,4 +264,4 @@ require ( gorm.io/plugin/dbresolver v1.6.2 // indirect ) -replace github.com/goravel/framework => github.com/goravel/framework v1.18.1-0.20260925114822-dab1968caa54 +replace github.com/goravel/framework => github.com/goravel/framework v1.18.1-0.20260925125002-93850001fe6f diff --git a/go.sum b/go.sum index d89c8b5..57c4521 100644 --- a/go.sum +++ b/go.sum @@ -317,8 +317,8 @@ github.com/goravel/example-proto v0.0.1 h1:ZxETeKREQWjuJ49bX/Hqj1NLR5Vyj489Ks6dR github.com/goravel/example-proto v0.0.1/go.mod h1:I8IPsHr4Ndf7KxmdsRpBR2LQ0Geo48+pjv9IIWf3mZg= github.com/goravel/fiber v1.18.1-0.20260901101548-72e06e6c5635 h1:iqzZ0P+KC8uBFNQ7PISL81U8CUc9myzS14NRYfftOB4= github.com/goravel/fiber v1.18.1-0.20260901101548-72e06e6c5635/go.mod h1:fk0YaivBle83SlSsPziy5+TRMavqlAr/QeVNo6pRmJA= -github.com/goravel/framework v1.18.1-0.20260925114822-dab1968caa54 h1:3f7twoPYBZepXNmbJR3TEQAf+PwoBIBKfOgegnDu2RY= -github.com/goravel/framework v1.18.1-0.20260925114822-dab1968caa54/go.mod h1:7Phix1gVUYzA1muoX1o92AJszuDgBUgO31ICCCJ7+Xw= +github.com/goravel/framework v1.18.1-0.20260925125002-93850001fe6f h1:/hWkvKBhtOPb6k1awR5scXcaLTHS+r1Rh3pS9O0DVIg= +github.com/goravel/framework v1.18.1-0.20260925125002-93850001fe6f/go.mod h1:7Phix1gVUYzA1muoX1o92AJszuDgBUgO31ICCCJ7+Xw= github.com/goravel/gemini v1.18.0 h1:Tv6IJ3KvBvH5QD7kAM3XFQR0g8IUfkqMbRGi7dtlWUo= github.com/goravel/gemini v1.18.0/go.mod h1:b4FueB0O0Qkz71eVWLiSaKghp+Eb/1hNNICkk7vMgrQ= github.com/goravel/gin v1.18.1-0.20260926005436-467f03c48058 h1:EId8wBSolUZQ00QQz4fyPrRWN+Tz/TZAw4u65XwSINY= diff --git a/tests/feature/validation_lang_test.go b/tests/feature/validation_lang_test.go index 6831e02..f4ebfbf 100644 --- a/tests/feature/validation_lang_test.go +++ b/tests/feature/validation_lang_test.go @@ -5,6 +5,7 @@ import ( "encoding/json" "os" "path/filepath" + "sync" "testing" _ "unsafe" @@ -16,14 +17,17 @@ import ( ) // The translation package caches loaded lang messages in a package-level -// `loaded` map that never expires. When lang:publish populates this cache +// `loaded` sync.Map that never expires. When lang:publish populates this cache // with custom messages during TestValidationLangTestSuite, those messages // leak into TestValidationTestSuite (which runs next alphabetically), -// causing default-message assertions to fail. Resetting the map here forces +// causing default-message assertions to fail. Clearing the map here forces // the translator to reload from the embedded defaults fresh after each test. // +// The linkname below is not type checked: the declaration must match the type +// of translation.loaded, otherwise the reset silently stops working. +// //go:linkname translationLoaded github.com/goravel/framework/translation.loaded -var translationLoaded map[string]map[string]map[string]any +var translationLoaded sync.Map type ValidationLangTestSuite struct { suite.Suite @@ -43,7 +47,7 @@ func (s *ValidationLangTestSuite) SetupTest() { func (s *ValidationLangTestSuite) TearDownTest() { s.removeValidationLangFiles() - translationLoaded = make(map[string]map[string]map[string]any) + translationLoaded.Clear() } func (s *ValidationLangTestSuite) removeValidationLangFiles() {