Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Go lang access denied

I'm new to the GO programming language, what I'm trying to do is to put some items into the map and then remove one of them, when I'm trying to remove one of the items from array I'm getting the error message:

C:/Go\bin\go.exe run C:/Users/Computer/IdeaProjects/untitled1/simple.go
fork/exec C:\Users\Computer\AppData\Local\Temp\go-build143466426\command-line-arguments\_obj\exe\simple.exe: Access is denied.

the code:

package main

import "fmt"

    func main(){
    
        presAge := make(map[string] int)
    
        presAge["test"] = 42
        presAge["boom"] = 421
    
        delete(presAge,"boom")
    
        fmt.Println(len(presAge))
    
    }
like image 807
TheName Avatar asked Mar 25 '17 17:03

TheName


2 Answers

I can only speak for my own case. I ran into the similar error using Windows 10. After some experiments, it looks like the error came from Avira, the anti-virus software I was using. Basically, the .exe file is detected by Avira as containing the pattern of a type of virus (called HEUR/APC (Cloud) in my case), which prevents the program from executing.

After I disabled my anti-virus software, everything went back to normal.

like image 50
Nicholas Avatar answered Sep 28 '22 12:09

Nicholas


for me I used avira just add C:\Users\Computer\AppData\Local\Temp floder to exception folder for realtime-protection.

Solved my problem

like image 34
adals Avatar answered Sep 28 '22 11:09

adals