The relationship of packages in go language

A go package is actually a directory, so what"s the difference between a net package and a net/http package? is there a dependency between a http package located in a directory under the net package at the same level as the code file of the net package? Or this layout structure, is there an equal relationship between the two?

Apr.07,2021

there is no inevitable relationship between the file name and the package name. The path is filled in the import, and the package name is entered when the call is made. There can only be one package name in a file directory. For example, a net package can have multiple package names in a multi-tier structure. Golang does not support circular references. Designing this hierarchical relationship can avoid circular references. To put it simply, the higher the directory is, the lower the code is.


should include the parent-subset relationship, but it is not a dependency relationship, it is just a division of modularization, which is more specifically divided by module.


dependency, net depends on net/http

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b3da06-413ed.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b3da06-413ed.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?