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? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
var tokenService service.TokenService var tokenGranter service.TokenGranter var tokenEnhancer service.TokenEnhancer var tokenStore service.TokenStore var userDetailsService service.UserDetailsService var clientDetailsService service.ClientDetailsService var srv service.Service tokenEnhancer = service.NewJwtTokenEnhancer("secret") tokenStore = service.NewJwtTokenStore(tokenEnhancer.(*service.JwtTokenEnhancer)) tokenService = service.NewTokenService(tokenStore, tokenEnhancer)
这里的定义感觉不太好, service.NewJwtTokenStore(tokenEnhancer.(*service.JwtTokenEnhancer)) 这里的形参应该定义成接口,而这里声明部分使用了接口声明, 然后NewJwtTokenEnhancer以后传给接口变量,最后传给NewJwtTokenStore做实参的时候又将接口类型转换成结构体 规范写法应该在NewJwtTokenStore接收的地方就是接口 这样写让看代码的人感觉结构不清晰
The text was updated successfully, but these errors were encountered:
No branches or pull requests
这里的定义感觉不太好,
service.NewJwtTokenStore(tokenEnhancer.(*service.JwtTokenEnhancer))
这里的形参应该定义成接口,而这里声明部分使用了接口声明,
然后NewJwtTokenEnhancer以后传给接口变量,最后传给NewJwtTokenStore做实参的时候又将接口类型转换成结构体
规范写法应该在NewJwtTokenStore接收的地方就是接口
这样写让看代码的人感觉结构不清晰
The text was updated successfully, but these errors were encountered: