This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.
package gomock
func GetUserName(us UserService, id int) (string, error) {
// 使用依赖注入进来的具体结构体方法,通常为需要mock的方法
user, err := us.GetUser(id)
if err != nil {
return "", err
}
return user.Name, nil