文章详情

短信预约-IT技能 免费直播动态提醒

请输入下面的图形验证码

提交验证

短信预约提醒成功

go: 写入 stat 缓存: mkdir /User: 只读文件系统

2024-04-05 00:02

关注

哈喽!大家好,很高兴又见面了,我是编程网的一名作者,今天由我给大家带来一篇《go: 写入 stat 缓存: mkdir /User: 只读文件系统》,本文主要会讲到等等知识点,希望大家一起学习进步,也欢迎大家关注、点赞、收藏、转发! 下面就一起来看看吧!

问题内容

在 vs code 中安装 go pkg 时出现此错误。它尝试在 /user 下创建缓存目录,该目录显然是只读的,我们应该更改它的权限。 失败的 pkgs-

以模块模式在 /user/ajayk/code/go/bin 安装 10 个工具。 戈普克斯 勾画大纲 得到测试 修改标签 暗示 去玩 dlv dlv-dap 静态检查 哥们儿

Tools environment: GOPATH=/User/ajayk/code/go
Installing 10 tools at /User/ajayk/code/go/bin in module mode.
  gopkgs
  go-outline
  gotests
  gomodifytags
  impl
  goplay
  dlv
  dlv-dap
  staticcheck
  gopls

Installing github.com/uudashr/gopkgs/v2/cmd/gopkgs FAILED
{
 "killed": false,
 "code": 1,
 "signal": null,
 "cmd": "/usr/local/go/bin/go get -v github.com/uudashr/gopkgs/v2/cmd/gopkgs",
 "stdout": "",
 "stderr": "go: downloading github.com/uudashr/gopkgs v1.3.2\ngo: writing stat cache: mkdir /User: read-only file system\ngo: downloading github.com/uudashr/gopkgs/v2 v2.1.2\ngo get github.com/uudashr/gopkgs/v2/cmd/gopkgs: mkdir /User: read-only file system\n"
}
Installing github.com/ramya-rao-a/go-outline FAILED
{
 "killed": false,
 "code": 1,
 "signal": null,
 "cmd": "/usr/local/go/bin/go get -v github.com/ramya-rao-a/go-outline",
 "stdout": "",
 "stderr": "go: downloading github.com/ramya-rao-a/go-outline v0.0.0-20200117021646-2a048b4510eb\ngo get github.com/ramya-rao-a/go-outline: mkdir /User: read-only file system\n"
}
Installing github.com/cweill/gotests/gotests FAILED
{
 "killed": false,
 "code": 1,
 "signal": null,
 "cmd": "/usr/local/go/bin/go get -v github.com/cweill/gotests/gotests",
 "stdout": "",
 "stderr": "go: writing stat cache: mkdir /User: read-only file system\ngo: downloading github.com/cweill/gotests v1.6.0\ngo get github.com/cweill/gotests/gotests: mkdir /User: read-only file system\n"
}
Installing github.com/fatih/gomodifytags FAILED
{
 "killed": false,
 "code": 1,
 "signal": null,
 "cmd": "/usr/local/go/bin/go get -v github.com/fatih/gomodifytags",
 "stdout": "",
 "stderr": "go: writing stat cache: mkdir /User: read-only file system\ngo: downloading github.com/fatih/gomodifytags v1.13.0\ngo get github.com/fatih/gomodifytags: mkdir /User: read-only file system\n"
}
Installing github.com/josharian/impl FAILED
{
 "killed": false,
 "code": 1,
 "signal": null,
 "cmd": "/usr/local/go/bin/go get -v github.com/josharian/impl",
 "stdout": "",
 "stderr": "go: writing stat cache: mkdir /User: read-only file system\ngo: downloading github.com/josharian/impl v1.0.0\ngo get github.com/josharian/impl: mkdir /User: read-only file system\n"
}
Installing github.com/haya14busa/goplay/cmd/goplay FAILED
{
 "killed": false,
 "code": 1,
 "signal": null,
 "cmd": "/usr/local/go/bin/go get -v github.com/haya14busa/goplay/cmd/goplay",
 "stdout": "",
 "stderr": "go: writing stat cache: mkdir /User: read-only file system\ngo: downloading github.com/haya14busa/goplay v1.0.0\ngo get github.com/haya14busa/goplay/cmd/goplay: mkdir /User: read-only file system\n"
}
Installing github.com/go-delve/delve/cmd/dlv FAILED
{
 "killed": false,
 "code": 1,
 "signal": null,
 "cmd": "/usr/local/go/bin/go get -v github.com/go-delve/delve/cmd/dlv",
 "stdout": "",
 "stderr": "go: writing stat cache: mkdir /User: read-only file system\ngo: downloading github.com/go-delve/delve v1.6.1\ngo get github.com/go-delve/delve/cmd/dlv: mkdir /User: read-only file system\n"
}
Installing github.com/go-delve/delve/cmd/dlv@master FAILED
{
 "killed": false,
 "code": 1,
 "signal": null,
 "cmd": "/usr/local/go/bin/go get -v -d github.com/go-delve/delve/cmd/dlv@master",
 "stdout": "",
 "stderr": "go: writing stat cache: mkdir /User: read-only file system\ngo: writing stat cache: mkdir /User: read-only file system\ngo: downloading github.com/go-delve/delve v1.6.2-0.20210528182153-b2afb7cd209e\ngo get github.com/go-delve/delve/cmd/dlv@master: mkdir /User: read-only file system\n"
}
Installing honnef.co/go/tools/cmd/staticcheck FAILED
{
 "killed": false,
 "code": 1,
 "signal": null,
 "cmd": "/usr/local/go/bin/go get -v honnef.co/go/tools/cmd/staticcheck",
 "stdout": "",
 "stderr": "go: writing stat cache: mkdir /User: read-only file system\ngo: downloading honnef.co/go/tools v0.2.0\ngo get honnef.co/go/tools/cmd/staticcheck: mkdir /User: read-only file system\n"
}
Installing golang.org/x/tools/gopls FAILED
{
 "killed": false,
 "code": 1,
 "signal": null,
 "cmd": "/usr/local/go/bin/go get -v golang.org/x/tools/gopls",
 "stdout": "",
 "stderr": "go: writing stat cache: mkdir /User: read-only file system\ngo: writing stat cache: mkdir /User: read-only file system\ngo: downloading golang.org/x/tools v0.1.2\ngo: downloading golang.org/x/tools/gopls v0.6.11\ngo get golang.org/x/tools/gopls: mkdir /User: read-only file system\n"
}

10 tools failed to install.


正确答案


快速解决方法是,从终端直接在 gopath 中安装这些软件包。安装后,在 gopath 中检查您的 pkg。

ajayk@ajays-MacBook-Pro-2 code % /usr/local/go/bin/go get -v github.com/uudashr/gopkgs/v2/cmd/gopkgs
go: downloading github.com/uudashr/gopkgs v1.3.2
go: downloading github.com/uudashr/gopkgs/v2 v2.1.2
go: downloading github.com/uudashr/gopkgs v2.0.1+incompatible
go: downloading github.com/karrick/godirwalk v1.12.0
go: downloading github.com/pkg/errors v0.8.1
github.com/pkg/errors
github.com/karrick/godirwalk
github.com/uudashr/gopkgs/v2
github.com/uudashr/gopkgs/v2/cmd/gopkgs
ajayk@ajays-MacBook-Pro-2 code % /usr/local/go/bin/go get -v github.com/ramya-rao-a/go-outline
go: downloading github.com/ramya-rao-a/go-outline v0.0.0-20200117021646-2a048b4510eb
golang.org/x/tools/go/buildutil
github.com/ramya-rao-a/go-outline
ajayk@ajays-MacBook-Pro-2 code % /usr/local/go/bin/go get -v github.com/cweill/gotests/gotests
go: downloading github.com/cweill/gotests v1.6.0
go: downloading golang.org/x/tools v0.0.0-20191109212701-97ad0ed33101
golang.org/x/tools/internal/semver
github.com/cweill/gotests/internal/models
golang.org/x/tools/go/ast/astutil
golang.org/x/tools/internal/fastwalk
golang.org/x/tools/internal/module
golang.org/x/tools/internal/span
golang.org/x/tools/go/internal/packagesdriver
golang.org/x/tools/go/internal/gcimporter
github.com/cweill/gotests/internal/goparser
github.com/cweill/gotests/internal/input
golang.org/x/tools/internal/gopathwalk
github.com/cweill/gotests/internal/render/bindata
github.com/cweill/gotests/templates
github.com/cweill/gotests/internal/render
golang.org/x/tools/go/gcexportdata
golang.org/x/tools/go/packages
golang.org/x/tools/internal/imports
golang.org/x/tools/imports
github.com/cweill/gotests/internal/output
github.com/cweill/gotests
github.com/cweill/gotests/gotests/process
github.com/cweill/gotests/gotests
ajayk@ajays-MacBook-Pro-2 code % /usr/local/go/bin/go get -v github.com/fatih/gomodifytags
go: downloading github.com/fatih/gomodifytags v1.13.0
go: downloading github.com/fatih/structtag v1.2.0
go: downloading github.com/fatih/camelcase v1.0.0
go: downloading golang.org/x/tools v0.0.0-20180824175216-6c1c5e93cdc1
github.com/fatih/camelcase
github.com/fatih/structtag
golang.org/x/tools/go/buildutil
github.com/fatih/gomodifytags
ajayk@ajays-MacBook-Pro-2 code % /usr/local/go/bin/go get -v github.com/josharian/impl
go: downloading github.com/josharian/impl v1.0.0
go: downloading golang.org/x/tools v0.0.0-20200522201501-cb1345f3a375
go: downloading golang.org/x/mod v0.2.0
go: downloading golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543
golang.org/x/mod/semver
golang.org/x/xerrors/internal
golang.org/x/tools/internal/event/label
golang.org/x/tools/internal/fastwalk
golang.org/x/xerrors
golang.org/x/tools/go/ast/astutil
golang.org/x/tools/internal/event/keys
golang.org/x/tools/internal/gopathwalk
golang.org/x/mod/module
golang.org/x/tools/internal/event/core
golang.org/x/tools/internal/event
golang.org/x/tools/internal/gocommand
golang.org/x/tools/internal/imports
golang.org/x/tools/imports
github.com/josharian/impl
ajayk@ajays-MacBook-Pro-2 code % /usr/local/go/bin/go get -v github.com/haya14busa/goplay/cmd/goplay
go: downloading github.com/haya14busa/goplay v1.0.0
go: downloading github.com/skratchdot/open-golang v0.0.0-20200116055534-eef842397966
github.com/skratchdot/open-golang/open
github.com/haya14busa/goplay
github.com/haya14busa/goplay/cmd/goplay
ajayk@ajays-MacBook-Pro-2 code % /usr/local/go/bin/go get -v github.com/go-delve/delve/cmd/dlv
go: downloading github.com/go-delve/delve v1.6.1
go: downloading github.com/sirupsen/logrus v1.6.0
go: downloading github.com/spf13/cobra v0.0.0-20170417170307-b6cb39589372
go: downloading github.com/mattn/go-isatty v0.0.3
go: downloading gopkg.in/yaml.v2 v2.2.1
go: downloading github.com/google/go-dap v0.5.0
go: downloading golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae
go: downloading github.com/cosiner/argv v0.1.0
go: downloading github.com/mattn/go-colorable v0.0.0-20170327083344-ded68f7a9561
go: downloading github.com/peterh/liner v0.0.0-20170317030525-88609521dc4b
go: downloading github.com/hashicorp/golang-lru v0.5.4
go: downloading golang.org/x/arch v0.0.0-20190927153633-4e8777c89be4
go: downloading go.starlark.net v0.0.0-20200821142938-949cc6f4b097
go: downloading github.com/cpuguy83/go-md2man v1.0.10
go: downloading github.com/spf13/pflag v0.0.0-20170417173400-9e4c21054fa1
go: downloading github.com/inconshreveable/mousetrap v1.0.0
go: downloading github.com/konsorten/go-windows-terminal-sequences v1.0.3
go: downloading github.com/russross/blackfriday v1.5.2
go: downloading github.com/russross/blackfriday v1.6.0
golang.org/x/sys/internal/unsafeheader
github.com/hashicorp/golang-lru/simplelru
go.starlark.net/internal/spell
github.com/mattn/go-isatty
golang.org/x/sys/unix
github.com/cosiner/argv
github.com/go-delve/delve/pkg/goversion
gopkg.in/yaml.v2
github.com/go-delve/delve/pkg/dwarf/util
github.com/go-delve/delve/pkg/dwarf/regnum
github.com/go-delve/delve/pkg/version
github.com/go-delve/delve/pkg/astutil
github.com/go-delve/delve/pkg/elfwriter
golang.org/x/arch/arm64/arm64asm
github.com/go-delve/delve/pkg/terminal/colorize
golang.org/x/arch/x86/x86asm
github.com/go-delve/delve/pkg/dwarf/op
github.com/go-delve/delve/pkg/dwarf/line
github.com/go-delve/delve/pkg/dwarf/frame
github.com/peterh/liner
go.starlark.net/syntax
github.com/google/go-dap
net/rpc
github.com/spf13/pflag
github.com/russross/blackfriday
github.com/go-delve/delve/pkg/dwarf/godwarf
net/rpc/jsonrpc
github.com/go-delve/delve/pkg/dwarf/loclist
github.com/go-delve/delve/pkg/dwarf/reader
go.starlark.net/resolve
github.com/cpuguy83/go-md2man/md2man
github.com/spf13/cobra
go.starlark.net/internal/compile
github.com/sirupsen/logrus
github.com/spf13/cobra/doc
github.com/go-delve/delve/pkg/config
go.starlark.net/starlark
github.com/go-delve/delve/pkg/logflags
github.com/go-delve/delve/pkg/gobuild
github.com/go-delve/delve/pkg/proc
github.com/go-delve/delve/pkg/proc/winutil
github.com/go-delve/delve/pkg/proc/amd64util
github.com/go-delve/delve/pkg/proc/native
github.com/go-delve/delve/service/api
github.com/go-delve/delve/pkg/proc/core/minidump
github.com/go-delve/delve/pkg/proc/linutil
github.com/go-delve/delve/pkg/locspec
github.com/go-delve/delve/pkg/proc/core
github.com/go-delve/delve/pkg/proc/gdbserial
github.com/go-delve/delve/service/debugger
github.com/go-delve/delve/service
github.com/go-delve/delve/service/rpc1
github.com/go-delve/delve/service/rpc2
github.com/go-delve/delve/pkg/terminal/starbind
github.com/go-delve/delve/service/rpccommon
github.com/go-delve/delve/pkg/terminal
github.com/go-delve/delve/service/dap
github.com/go-delve/delve/cmd/dlv/cmds
github.com/go-delve/delve/cmd/dlv
ajayk@ajays-MacBook-Pro-2 code % /usr/local/go/bin/go get -v -d github.com/go-delve/delve/cmd/dlv@master
go: downloading github.com/go-delve/delve v1.6.2-0.20210528182153-b2afb7cd209e
ajayk@ajays-MacBook-Pro-2 code % /usr/local/go/bin/go get -v honnef.co/go/tools/cmd/staticcheck
go: downloading honnef.co/go/tools v0.2.0
go: downloading golang.org/x/tools v0.1.0
go: downloading golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4
go: downloading golang.org/x/mod v0.3.0
golang.org/x/mod/semver
honnef.co/go/tools/internal/sync
honnef.co/go/tools/sarif
honnef.co/go/tools/knowledge
honnef.co/go/tools/printf
golang.org/x/tools/internal/lsp/fuzzy
golang.org/x/sys/execabs
golang.org/x/tools/internal/event/label
honnef.co/go/tools/internal/robustio
honnef.co/go/tools/lintcmd/version
golang.org/x/tools/go/ast/astutil
golang.org/x/tools/go/ast/inspector
golang.org/x/tools/go/buildutil
golang.org/x/tools/go/internal/gcimporter
golang.org/x/tools/internal/typesinternal
honnef.co/go/tools/internal/go/gcimporter
golang.org/x/tools/go/types/objectpath
golang.org/x/tools/go/internal/cgo
golang.org/x/tools/internal/event/keys
honnef.co/go/tools/internal/renameio
honnef.co/go/tools/pattern
honnef.co/go/tools/unused/typemap
honnef.co/go/tools/internal/cache
golang.org/x/tools/internal/event/core
golang.org/x/tools/internal/event
golang.org/x/tools/internal/gocommand
golang.org/x/tools/internal/analysisinternal
honnef.co/go/tools/go/ast/astutil
golang.org/x/tools/go/types/typeutil
golang.org/x/tools/go/loader
golang.org/x/tools/go/internal/packagesdriver
golang.org/x/tools/internal/packagesinternal
honnef.co/go/tools/go/types/typeutil
golang.org/x/tools/go/analysis
honnef.co/go/tools/go/ir
honnef.co/go/tools/analysis/lint
golang.org/x/tools/go/analysis/passes/inspect
honnef.co/go/tools/config
golang.org/x/tools/go/gcexportdata
golang.org/x/tools/go/packages
honnef.co/go/tools/analysis/edit
honnef.co/go/tools/go/loader
honnef.co/go/tools/internal/passes/buildir
honnef.co/go/tools/go/ir/irutil
honnef.co/go/tools/analysis/facts/nilness
honnef.co/go/tools/analysis/facts/typedness
honnef.co/go/tools/analysis/facts
honnef.co/go/tools/analysis/report
honnef.co/go/tools/analysis/code
honnef.co/go/tools/internal/sharedcheck
honnef.co/go/tools/unused
honnef.co/go/tools/stylecheck
honnef.co/go/tools/quickfix
honnef.co/go/tools/simple
honnef.co/go/tools/staticcheck
honnef.co/go/tools/lintcmd/runner
honnef.co/go/tools/lintcmd
honnef.co/go/tools/cmd/staticcheck
ajayk@ajays-MacBook-Pro-2 code % /usr/local/go/bin/go get -v golang.org/x/tools/gopls
ajayk@ajays-MacBook-Pro-2 code %

以上就是本文的全部内容了,是否有顺利帮助你解决问题?若是能给你带来学习上的帮助,请大家多多支持编程网!更多关于Golang的相关知识,也可关注编程网公众号。

阅读原文内容投诉

免责声明:

① 本站未注明“稿件来源”的信息均来自网络整理。其文字、图片和音视频稿件的所属权归原作者所有。本站收集整理出于非商业性的教育和科研之目的,并不意味着本站赞同其观点或证实其内容的真实性。仅作为临时的测试数据,供内部测试之用。本站并未授权任何人以任何方式主动获取本站任何信息。

② 本站未注明“稿件来源”的临时测试数据将在测试完成后最终做删除处理。有问题或投稿请发送至: 邮箱/279061341@qq.com QQ/279061341

软考中级精品资料免费领

  • 历年真题答案解析
  • 备考技巧名师总结
  • 高频考点精准押题
  • 2024年上半年信息系统项目管理师第二批次真题及答案解析(完整版)

    难度     813人已做
    查看
  • 【考后总结】2024年5月26日信息系统项目管理师第2批次考情分析

    难度     354人已做
    查看
  • 【考后总结】2024年5月25日信息系统项目管理师第1批次考情分析

    难度     318人已做
    查看
  • 2024年上半年软考高项第一、二批次真题考点汇总(完整版)

    难度     435人已做
    查看
  • 2024年上半年系统架构设计师考试综合知识真题

    难度     224人已做
    查看

相关文章

发现更多好内容

猜你喜欢

AI推送时光机
位置:首页-资讯-后端开发
咦!没有更多了?去看看其它编程学习网 内容吧
首页课程
资料下载
问答资讯