hertz-examples
hertz-examples copied to clipboard
In the example:middleware/csrf/custom_errorfunc/main.go,the function myErrFunc does not implement what the author wants.
In the example:middleware/csrf/custom_errorfunc/main.go,the function myErrFunc does not implement what the author wants. https://github.com/cloudwego/hertz-examples/blob/231bdf80c234de47a79b312326a8dd6a0e74de2b/middleware/csrf/custom_errorfunc/main.go#L32-L40 https://github.com/cloudwego/hertz-examples/blob/231bdf80c234de47a79b312326a8dd6a0e74de2b/middleware/csrf/custom_errorfunc/main.go#L42-L54
The switch statement can't be used for error handling in this way, which may be misleading for those reading this example.
Thanks for the reminder.