mirror of
https://github.com/go-admin-team/go-admin.git
synced 2026-09-21 10:13:01 +00:00
The comment said the test had to be declared first because Go runs a package's tests in source order. That is not a guarantee, and it is not what makes this work: the test that registers RoleCheck puts it back in a t.Cleanup, and the guard here turns a wrong order into a loud failure rather than a silent pass. Verified with go test -shuffle on seeds that run the two in either order. Claude-Session: https://claude.ai/code/session_01HPTAw8b8tAdFNFn8rKdPYx