dtvgo28624 2015-09-03 03:49
浏览 403
已采纳

Golang,使用子包中的主包的结构或功能

I am trying to write a go project with several sub projects. For an simple example the project looks like this

Main
 |- package one
    |- package one.one
    |- package one.two
 |- package two

From my main package i can use any function or structure of any sub package By importing them. But My question is how can i access an struct or function of main from any sub package.

  • 写回答

2条回答 默认 最新

  • duang8642 2015-09-03 10:42
    关注

    Thanks. I solved this problem by using an third package. Pretty easy that way.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?