jenglong1899

Results comments of jenglong1899

Is the code you provided a suggestion for implementation? I noticed that there are two interface: ```go // [email protected]/rest/httpx/requests.go // Validator defines the interface for validating the request. type Validator...

https://github.com/zeromicro/go-zero/blob/01bbc78baca219655b9618ca5b6df70c9662a29b/rest/httpx/requests.go#L55-L59 https://github.com/zeromicro/go-zero/blob/01bbc78baca219655b9618ca5b6df70c9662a29b/rest/httpx/requests.go#L31-L35 **question 1** I am confused about the design of the interface `Validator`, I think the validating functionality is not related to the http.Request, it only related to the...

> It may be necessary to verify the path or header content. For a struct, you can use a tag to register validation rules: ``` type SignUpReq struct{ Email string...

> Show your code and discuss it further. https://github.com/Linde7777/go-zero/tree/auto_validation/rest/httpx I have finished the part of validating struct and the lazy initialization

https://github.com/zeromicro/go-zero/blob/4a62d084a93fb50cb85ca62bc8620b041cdc1a4a/rest/httpx/requests_test.go#L509-L514 It seems that the code you provide didn't answer "how to register validation rules for http.Request?" For register validation rule of http.Request, I have figured out two method: ###...

I got it, what about setting go-playground's validator as a default validator? I think many people would like to use it. The implementation will be lazy initialization.

A goctl template can do this, but this default validator feature let user don't need to write any code, for the lazy man like me, it is convenient

besides the motion stuttering, those dots makes the text unclear, make me hard to watch AI's operation

Thank you! It works! I am using Clash, but when it was running successfully before, I also had Clash enabled