0

ETA. Okay, based on some advice I'd received, I used go build main.go rather than go run main.go

This puts the main.exe in my project folder (which I excluded) rather than putting a temporary main.exe in the Temp Folder (which would be bad folder to exclude in your AV.)

Able to run now.


This question is for any Golang developers who work on Windows and have MalwareBytes installed. (Answers from other OS users who have MalwareBytes and GO installed welcome!)

Can you run a simple program with an http call?

See this for more details: Go program exits with no output if it has a simple http.Get call

As I mentioned in the closed question - the problem was my antivirus (MalwareBytes)

I'm still working with MalwareBytes on the issue...but I wanted to see if anyone else is currently able to get a http-method-using Golang program to play nice with MalwareBytes, especially on Windows.

If you are, are you using any exclusions and if so, which ones? I excluded the Golang folder in my Program Files, and the folder with my project code, but it doesn't help.

Thanks for any insight!

YvetteS
  • 1
  • 3
  • You can't fix an AV bug by changing your code. That's why the other question was closed. In any case you didn't post any code or errors *in this question*, so it's impossible to provide any answer except generic advice like adding an AV exception for your program or folder, or contact the vendor – Panagiotis Kanavos Jun 16 '22 at 16:06
  • It's quite possible the problem isn't the *antivirus* but a *firewall* installed along with the antivirus that blocks outgoing HTTP calls. In any case, this isn't a programming question. It's a matter of configuring your AV – Panagiotis Kanavos Jun 16 '22 at 16:09
  • Thanks for your input. I did verify that it was Malwarebytes that was the issue and not the Firewall, and have made Malwarebytes aware of the problem. I've found a way to get around this, so I've put that in the answers – YvetteS Jun 16 '22 at 16:37
  • I appreciate your input that this question didn't have any Go code in it and wasn't caused by an error in the code, and I'll try to keep that POV in mind for future questions. However, it may be useful to note that I can run a Java program with a get call in it from the same environment without the same issue. In addition, the workaround turned out to involve using a different Go command. – YvetteS Jun 16 '22 at 16:49

1 Answers1

0

Okay, based on some advice I'd received, I used go build main.go rather than go run main.go.

This puts the main.exe in my project folder (which I excluded) rather than putting a temporary main.exe in the Temp Folder (which would be bad folder to exclude in your AV.)

When I do that, I can run the newly built exe in my project folder.

Able to run now.

ChrisGPT was on strike
  • 127,765
  • 105
  • 273
  • 257
YvetteS
  • 1
  • 3