go: error obtaining buildID for go tool compile: open NUL: The system cannot find the file specified.
go: error obtaining buildID for go tool compile: open NUL: The system cannot find the file specified.
问题
今天遇到了使用go run 报错 :
go tool compile: open NUL: The system cannot find the file specified.
在网上看了一堆都是转载的同一篇文章,让升级系统,但是我的系统本身就是最新的预览版系统,没法再继续升级。就在抠脑壳之际,我忽然发现系统有一个null.sys文件之前被我替换过一次,我猜测很有可能是这个文件出了问题。于是找别人给我拷贝了一份替换掉,系统就恢复正常了。
步骤
获取null.sys文件 (链接:https://pan.baidu.com/s/14zuvdsh3UlFZl4QeQNwkeg 提取码:hwtw) 或者找一个和你win10版本一样
将文件放到C:\Windows\System32\drivers下(记得保留之前的null.sys文件,以防替换出问题后还可以换回来)这里会有权限问题,参考这里:https://zhidao.baidu.com/question/585614610290100765.html
百度搜的,看看能否解决你问题?
7 回答5.3k 阅读
6 回答6.8k 阅读✓ 已解决
4 回答2.3k 阅读
1 回答3.4k 阅读
2 回答2.2k 阅读
1 回答2.1k 阅读
1 回答1.5k 阅读
可能是你的 Go 环境变量设置不对或者 Go 安装包损坏了。检查一下GOROOT、GOPATH 和 GOBIN 环境变量