How to restrict opening of go build file?

how to restrict opening of go build file.
I want to create a golang executable(build) file which can’t be open through any notepad kind of tools.
Or If they try to open suggest a way to remove a content in the build file.

1 Like

Do you want to have a source file which no one can read? Just do not distribute it.

Otherwise I’m not sure if I understand you correctly.

2 Likes

Thanks for replying,
I created a golang executable file. After opening it in notepad++, I can able to see 3rd party package details like “github.com/sirupsen/logrus”. I don’t want someone know what third party packages atleast as clear as above I’m using(with complete url of Git package). To avoid that, I want to make the executable as non readable with any editors or if there is any way to delete the content of file someone tries to open it. Please suggest me a best way to prevent someone can read the content of a file.

1 Like

Hi. Build with

go build -ldflags "-s -w" .

And debug and symbol info will be removed. I don’t know if package names are removed. But maybe. Reference here https://golang.org/cmd/link/

2 Likes

Thanks for replying,
Ya, still package names are there.
It’s kind of URL no, we can copy and paste in browser which leads us to git repo.
So, wanted to avoid it.

1 Like

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.