golang gin-gonic and splitting files in package

前端 未结 1 410
囚心锁ツ
囚心锁ツ 2021-01-28 09:53

I am quite new to go and try to learn, I am setting up an application with a gin-gonic server. I managed to have it to work with everything in on main package, I would like to o

相关标签:
1条回答
  • 2021-01-28 10:21

    I did manage to make it work by "sending" the router in the LoadTodo function :

    in apirest.go :

    LoadTodo(Router)
    

    and in todoCRUD.go :

    func LoadTodo(r *gin.Engine){
    

    and it's working fine ... I hope I didn't bring a bug failure in the code ...

    Stéphane

    0 讨论(0)
提交回复
热议问题