This article builds up on the last part where we built a simple REST API with Go. Now, let's connect our API with a real database! Here, we will us...
For further actions, you may consider blocking this person and/or reporting abuse
Great tutorial. Appreciate the effort. Cheers
Thanks!
Great Tutorial I've ever found.
I try this with another example. I want to divide 2 more folders under handlers (one for horror and one for fantasy). Under each folder I want to add 4 go file for CRUD functions.
But everything is ok when I write like this.
But in the main.go file, there is an error like
"h.GetAllCategory undefined (type content.handler has no field or method GetAllCategory)" .
What should I do?
Thank you! I belive if you divide folders, you'll need to create new packages. Example, package a and package b. Then use it like: a.MethodX or b.MethodY. I can help more if I can see a github repo
Thanks for your reply. I got the answer. You're right. I needed to create new packages and import the package when I need to call from another package. Plz create and write more post about advanced Golang. Your posts help a lot for newbies like me.
Thank you! I created a Go course, Chapter IV has some advanced topics that you might like
Thank you..
Hello Karan, thanks for the tutorial!
I am looking forward to your next post. In particular, I am very interested in writing unit tests for the database layer. With GORM V1 github.com/jinzhu/gorm I used go-mocket github.com/selvatico/go-mocket, and now I am looking for a way to migrate to GORM V2 and update unit tests.
Thank you Natallia, means a lot!
Great, help me with some doubts I had with the grom library.
Obrigado pelo tutorial!