简体   繁体   中英

Publishing Golang Package and dependencies

How do you deal package dependencies? For example, say I have a package that I want to publish for all to use, and in developing that package I am using 3rd party packages. For this example lets say github.com/gorilla/websocket is one and github.com/sirupsen/logrus is another one. Will the go tools automatically see my “includes” and go get these packages? Do I have to put it my description that you need to have these installed before my package will work? Should I include them in my own sources somehow (which I doubt but not leaving anything out)? What is the recommended way to handle this? One thing to note is that I am using the Go 1.11 modules system so I do have my dependencies listed in my go.mod file. Is that enough?

无需担心这一点,因为go get会为您完成。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM