Library/models/books_list.go

14 lines
183 B
Go

package models
import "fmt"
func ListBooks() (books []*Book, err error) {
err = x.Find(&books)
if err != nil {
fmt.Println("Error getting Books", err)
}
return books, err
}