Answer the question
In order to leave comments, you need to log in
How to correctly read a function in GO?
I am just starting to learn the GO language. Help read the function in human language.
func (p *myDb) SelectUsers() ([]*model.User, error) {
user := make([]*model.User, 0)
if err := p.sqlSelectUsers.Select(&user); err != nil {
return nil, err
}
return user, nil
}
Answer the question
In order to leave comments, you need to log in
user := make([]*model.User, 0)
a slice receiver is declared for the *model.User array
if err := p.sqlSelectUsers.Select(&user); err != nil {
return nil, err
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question