-1

I am trying to create a .so file for entire Go module, my module directory looks something like this:

    goAgent/
       -- cavagent.go file
       -- modules/
          -- sample/
          -- differentsample/

When I make a .so of the goAgent/ , all I'm getting are the functions of the .go file and not those that present inside the other Go modules. Is there any known way where we can found the functions that are present inside the several Go modules?

What I want is that the functions that are present inside the Go files of modules i.e sample/ and differentsample/ should be available inside my .so.

If you can see below the names of the directory is goAgent/ and it contains a modules folder, which in turn contains different modules. I want the functions that are present inside the files of these sub modules to be present in my .so , a sort of common .so for the entire goAgent/ and sub-folders.

enter image description here

Currently my .so contains only the functions of cavagent.go file only.

I made my .so using the -buildmode=shared -linkshared command.

immukul
  • 87
  • 11
  • You can compile a package to a .so but there is not notion of "[G]o project". There simply are no Go "projects". All there is are packages and modules (which is just a set of packages versioned together). What are you actually trying to do? – Volker Sep 11 '20 at 07:58
  • Let me rephrase it, I want to create a .so for the entire module, the module contains a .go file and other modules inside it, I want the functions present inside of those files inside my .so too. – immukul Sep 11 '20 at 09:24

1 Answers1

-1

[Can I create a] shared object file in Go for an entire module [?]

No.

Volker
  • 40,468
  • 7
  • 81
  • 87