I've made Windows DLLs work with Go, so I can be done, but I would strongly suggest that you avoid it. Windows applications expect to be able to unload their DLLs, and you can never do that with Go. There are work arounds, (search this form for my previous posts), but they are ugly and fragile.
So, to save you alot of pain, I would advise you to use a server process as Brian suggests. You can provide in your SDK code wrapper methods that can, behind the scene if need be, start, stop, and makes RPC calls to that service to serve client requests. If need be, then the server could eventually remote, or shared over the network. If that doesn't work, I would just provide the source code to everything. On Wednesday, December 14, 2022 at 8:24:19 AM UTC-6 nsing...@gmail.com wrote: > Hi is there another way as we have to package it as a dll or a lib . > But whenever we try using syscall with dll it fails with "bad sweepgen in > refill" > Is there any other way where we font create a new executable > thanks > > On Monday, December 12, 2022 at 1:34:23 PM UTC+5:30 Brian Candler wrote: > >> Distribute your library as a grpc server. >> https://github.com/hashicorp/go-plugin >> >> On Monday, 12 December 2022 at 07:56:52 UTC nsing...@gmail.com wrote: >> >>> Actually i need to share it as an sdk. So any way i can share >>> >>> On Thursday, December 8, 2022 at 1:13:17 PM UTC+5:30 marc...@gmail.com >>> wrote: >>> >>>> if you produce an executable, nobody sees the actual Go code. >>>> build it with: >>>> go build -ldflags "-s -w" >>>> >>>> or you could try to obfuscate it: >>>> https://github.com/burrowers/garble >>>> >>>> or you can make a self-extracting executable >>>> >>>> >>>> Op woensdag 7 december 2022 om 19:09:31 UTC+1 schreef >>>> nsing...@gmail.com: >>>> >>>>> Hi All, >>>>> We are looking for a way to distribute a Golang Package. but We ant to >>>>> hide the Code which we have written. >>>>> We went Through Creating A DLL to distribute but it crashes at >>>>> different point while running. As we have distribute to Both linux and >>>>> windows . And i found that for linux we can use plugin. But the crash for >>>>> windows dll after importing the file is concerning for us and its >>>>> happening at random points in the code also "bad sweepgen in refill". >>>>> If there is any other way to distribute the code without showing the >>>>> source code please Tell >>>>> Thanks >>>>> Neeraj >>>>> >>>> -- 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 golang-nuts+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/3830515e-1358-46ad-88d3-087b29b8fa54n%40googlegroups.com.