windowsgofile-access

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))
    
    }

Solution

  • so the trick here is that you need to run your application as Administrator in Windows