On Mon, Jan 28, 2019 at 11:53 PM Aakash das <[email protected]> wrote: > > +golang-nuts. > > On Tue, Jan 29, 2019 at 1:20 PM Aakash das <[email protected]> wrote: >> >> Thanks for the reply, Ian. I have an additional question. Given a Go binary >> package file in '.a' format, would it be possible to extract dependencies >> for the said binary package using some tool? My end goal is to automate the >> generation of the stub file for binary-only packages provided by the vendors.
I think It is possible. I think that if you run `go tool nm` on the .a file, you will see undefined references to PKG.init. That should give you the list of imported packages. I'm not completely sure if every imported package will be listed reliably in that way, though. Ian >> On Tue, Jan 29, 2019 at 3:59 AM Ian Lance Taylor <[email protected]> wrote: >>> >>> On Mon, Jan 28, 2019 at 1:56 PM Aakash das <[email protected]> wrote: >>> > >>> > Hello everyone, >>> > The requirements for binary only source file has changed in Go 1.10. >>> > Could you please guide me to the steps that are needed for making binary >>> > only package work with Go 1.10. I couldn't find any example on generating >>> > a stub source '.go' file with dependencies explicitly specified. >>> >>> Write a Go file that looks like >>> >>> //go:binary-only-package >>> >>> func packagename >>> >>> import ( >>> "first/dependency" >>> "second/dependency" >>> ) >>> >>> Note that after the 1.12 release, binary-only packages will no longer >>> be supported. >>> >>> Ian -- 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 [email protected]. For more options, visit https://groups.google.com/d/optout.
