FAQ
Is there any good article on structuring go package hierarchy?

I see in `net` package, `net/http` package uses its parental(in terms of
path) package `net` and other packages in the same level (`net/textproto`).

Then is it discouraged, even without circular dependency, for a package to
call child package? For example, `net` package would call `net/helpers`
package if exists?

What is the best practice in go package structure? Thanks all. I love Go!

--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Search Discussions

  • Chris dollin at Nov 23, 2014 at 5:38 pm
    go doesn't have a package hierarchy. there is no notion of a .parent. or
    .child. package, even if packages are held in a hierarchical filing system.

    (not counting the notion of .internal. packages, which are a go toolbtactic
    not a piece of the language.)

    chris
      On Nov 23, 2014 5:11 PM, "Gyu-Ho Lee" wrote:

    Is there any good article on structuring go package hierarchy?

    I see in `net` package, `net/http` package uses its parental(in terms of
    path) package `net` and other packages in the same level (`net/textproto`).

    Then is it discouraged, even without circular dependency, for a package to
    call child package? For example, `net` package would call `net/helpers`
    package if exists?

    What is the best practice in go package structure? Thanks all. I love Go!

    --
    You received this message because you are subscribed to the Google Groups
    "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an
    email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.
    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.
  • Gyu-Ho Lee at Nov 23, 2014 at 5:59 pm
    Oh then it is even better. So I only need to be careful of package circular
    dependencies. Thanks!
    On Sun, Nov 23, 2014, 9:38 AM chris dollin wrote:

    go doesn't have a package hierarchy. there is no notion of a .parent. or
    .child. package, even if packages are held in a hierarchical filing system.

    (not counting the notion of .internal. packages, which are a go
    toolbtactic not a piece of the language.)

    chris
    On Nov 23, 2014 5:11 PM, "Gyu-Ho Lee" wrote:

    Is there any good article on structuring go package hierarchy?

    I see in `net` package, `net/http` package uses its parental(in terms of
    path) package `net` and other packages in the same level (`net/textproto`).

    Then is it discouraged, even without circular dependency, for a package
    to call child package? For example, `net` package would call `net/helpers`
    package if exists?

    What is the best practice in go package structure? Thanks all. I love Go!

    --
    You received this message because you are subscribed to the Google Groups
    "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an
    email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.
    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupgolang-nuts @
categoriesgo
postedNov 23, '14 at 5:11p
activeNov 23, '14 at 5:59p
posts3
users2
websitegolang.org

2 users in discussion

Gyu-Ho Lee: 2 posts Chris dollin: 1 post

People

Translate

site design / logo © 2022 Grokbase