type UserService struct {
	userDao IUserDao
}

func NewUserService (userDao IUserDao) {
	return UserService{ userDao: userDao }
}

func (s *UserService) Query(name string) {
	s.userDao.QueryUserFromDB(name)
}

// 调用方
func main () {
	userService := NewUserService(NewUserDao())
}

// 或者你的NewUserService方法可以写得更简单一点:

func NewUserService () {
	return UserService{ userDao: NewUserDao()}
}