3

Is it possible to install a Golang package system-wide and not need the source code afterwards in order to compile programs that use it?

More particularly, having just the pkg/linux_amd64_dynlink/ directory with, for example, libstringutil.so stringutil.a and stringutil.shlibname files, how can I compile a simple hello.go that imports stringutil?

user2424276
  • 581
  • 5
  • 21
  • do you mean as library? – sfault Feb 23 '16 at 11:31
  • 1
    this stack question might help [building-and-linking-dynamically-from-a-go-binary](http://stackoverflow.com/questions/19431296/building-and-linking-dynamically-from-a-go-binary) – sfault Feb 23 '16 at 13:32
  • it seems support is limited, on mac it gives following error `-buildmode=shared not supported on darwin/amd64` – sfault Feb 23 '16 at 13:36
  • tldr: no, and it is a good thing. Best thing is to create a service that does the generic things and call that. – RickyA Feb 23 '16 at 14:02

0 Answers0