Answer the question
In order to leave comments, you need to log in
What is the structure of a function in Go?
I had to parse a piece of go-code here, although I don’t write on it. Can you tell me what this syntax means?
func (book *Book) findData(user user.User) bool {
...
err = database.Conn.QueryRow(....).Scan(&book.Object.id, &book.Object.Text)
...
if ...
return true
}
Answer the question
In order to leave comments, you need to log in
book is a receiver, a data type that has this method. above they wrote that the receiver has the type "structure", so it is in this case, and so it is in 99% of other cases, but we must not forget an important nuance - in Go, any data type can have methods (not only struct) , either string or int
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question