go 接口作为方法参数传递
接口作为方法参数传递 在方法内部修改结构体,示例type IUserService interface { GenId()}type UserService struct { id string}func (u *UserService) GenId() { generateUUID, _ := uuid.GenerateUUID() u.id = generateUUID}func BuildUser(service IUserService) { service.Ge
原创
2021-01-08 17:22:25 ·
3890 阅读 ·
0 评论