create-go-app / fiber-go-template

📝 Production-ready backend template with Fiber Go Web Framework for Create Go App CLI.
https://github.com/create-go-app/cli/wiki
Apache License 2.0
925 stars 119 forks source link

Use Select instead of Get for fetching a slice of results #180

Closed nazmul-pro closed 1 year ago

nazmul-pro commented 1 year ago

Fixing a query bug for fetching all books Get is useful for fetching a single result and scanning it, and Select is useful for fetching a slice of results. Since our GetBooks() is for fetching all rows so instead of q.Get(&books, query) we need to change this query to q.Select(&books, query)

welcome[bot] commented 1 year ago

Thanks for opening this pull request! 🎉 Please check out our contributing guidelines.

welcome[bot] commented 1 year ago

Congrats on merging your first pull request! 🎉 We here at Create Go App are proud of you!