We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
go version go1.20.14 darwin/arm64
2.7.0
Option Yes
import ( "context" "github.com/gogf/gf/v2/frame/g" "github.com/gogf/gf/v2/test/gtest" "github.com/gogf/gf/v2/util/gtag" "testing" ) func init() { gtag.SetGlobalEnums(`{"shop/testing/t.Status":["Running","Offline"]}`) } func TestEnums(t *testing.T) { type Status string const ( StatusRunning Status = "Running" StatusOffline Status = "Offline" ) type BizReq struct { Id int `v:"required"` Name string `v:"required"` Status []Status `v:"foreach|enums"` } var ( ctx = context.Background() req = BizReq{ Id: 1, Name: "john", Status: []Status{"Running", "Offline"}, } ) gtest.C(t, func(t *gtest.T) { err := g.Validator().Data(req).Run(ctx) t.AssertNil(err) }) }
no pkg path found for type "[]t.Status"
verified passed
The text was updated successfully, but these errors were encountered:
Successfully merging a pull request may close this issue.
Go version
go version go1.20.14 darwin/arm64
GoFrame version
2.7.0
Can this bug be reproduced with the latest release?
Option Yes
What did you do?
What did you see happen?
no pkg path found for type "[]t.Status"
/Users/xxxx/workspace/go/src/julunet.com/shop/testing/t/f_test.go:54
/Users/xxxx/workspace/go/src/julunet.com/shop/testing/t/f_test.go:52
--- FAIL: TestEnums (0.00s)
FAIL
exit status 1
FAIL shop/testing/t 0.355s
What did you expect to see?
verified passed
The text was updated successfully, but these errors were encountered: