Go语言访问被拒绝 [英] Go lang access denied

查看:111
本文介绍了Go语言访问被拒绝的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是GO编程语言的新手,我想做的是将一些项目放入地图中,然后删除其中一项,当我尝试从数组中删除其中一项时,m收到错误消息:

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.

代码:

package main

import "fmt"

    func main(){

        presAge := make(map[string] int)

        presAge["test"] = 42
        presAge["boom"] = 421

        delete(presAge,"boom")

        fmt.Println(len(presAge))

    }

推荐答案

所以这里的窍门是您需要在Windows中以管理员身份运行应用程序

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

这篇关于Go语言访问被拒绝的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆