Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -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=
Expand Down
12 changes: 8 additions & 4 deletions tests/feature/validation_lang_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"encoding/json"
"os"
"path/filepath"
"sync"
"testing"
_ "unsafe"

Expand All @@ -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
Expand All @@ -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() {
Expand Down
Loading