码迷,mamicode.com
首页 > 其他好文 > 详细

【解决了一个小问题】golang build中因为缓存文件损坏导致的编译错误

时间:2021-04-29 11:53:31      阅读:0      评论:0      收藏:0      [点我收藏+]

标签:mat   lang   proxy   xxx   auto   过程   prefix   erro   缓存   

编译的过程中出现了一个吓人的错误:

GOROOT=C:\Go #gosetup
GOPATH=C:\Users\ahfuzhang\go #gosetup
C:\Go\bin\go.exe mod tidy #gosetup
go: downloading github.com/xxx/my_prj/public v0.0.14
github.com/xxx/my_prj/proxy_alloc_svr/cmd imports
	github.com/xxx/my_prj/public/pkg/base: git -c core.autocrlf=input -c core.eol=lf archive --format=zip --prefix=prefix/ d57403125286a6411e73163e184e2a88188a448d in C:\Users\ahfuzhang\go\pkg\mod\cache\vcs\1ae7172f3810140ab493892af4f3912f9d17b329d60308cecebd171197322c49: exit status 255:
	error: invalid object 100644 4994770929b65b148f8d80e1ef0be9b50b9cc6c5 for ‘pkg/defines/proxy.go‘
	error: cannot read 4994770929b65b148f8d80e1ef0be9b50b9cc6c5
github.com/xxx/my_prj/proxy_alloc_svr/cmd imports
	github.com/xxx/my_prj/public/pkg/config: git -c core.autocrlf=input -c core.eol=lf archive --format=zip --prefix=prefix/ d57403125286a6411e73163e184e2a88188a448d in C:\Users\ahfuzhang\go\pkg\mod\cache\vcs\1ae7172f3810140ab493892af4f3912f9d17b329d60308cecebd171197322c49: exit status 255:
	error: invalid object 100644 4994770929b65b148f8d80e1ef0be9b50b9cc6c5 for ‘pkg/defines/proxy.go‘
	error: cannot read 4994770929b65b148f8d80e1ef0be9b50b9cc6c5
github.com/xxx/my_prj/proxy_alloc_svr/cmd imports
	github.com/xxx/my_prj/public/pkg/middleware: git -c core.autocrlf=input -c core.eol=lf archive --format=zip --prefix=prefix/ d57403125286a6411e73163e184e2a88188a448d in C:\Users\ahfuzhang\go\pkg\mod\cache\vcs\1ae7172f3810140ab493892af4f3912f9d17b329d60308cecebd171197322c49: exit status 255:
	error: invalid object 100644 4994770929b65b148f8d80e1ef0be9b50b9cc6c5 for ‘pkg/defines/proxy.go‘
	error: cannot read 4994770929b65b148f8d80e1ef0be9b50b9cc6c5
github.com/xxx/my_prj/proxy_alloc_svr/cmd imports
	github.com/xxx/my_prj/public/pkg/utils: git -c core.autocrlf=input -c core.eol=lf archive --format=zip --prefix=prefix/ d57403125286a6411e73163e184e2a88188a448d in C:\Users\ahfuzhang\go\pkg\mod\cache\vcs\1ae7172f3810140ab493892af4f3912f9d17b329d60308cecebd171197322c49: exit status 255:
	error: invalid object 100644 4994770929b65b148f8d80e1ef0be9b50b9cc6c5 for ‘pkg/defines/proxy.go‘
	error: cannot read 4994770929b65b148f8d80e1ef0be9b50b9cc6c5
github.com/xxx/my_prj/proxy_alloc_svr/internal/endpoint/proxy imports
	github.com/xxx/my_prj/public/pkg/defines: git -c core.autocrlf=input -c core.eol=lf archive --format=zip --prefix=prefix/ d57403125286a6411e73163e184e2a88188a448d in C:\Users\ahfuzhang\go\pkg\mod\cache\vcs\1ae7172f3810140ab493892af4f3912f9d17b329d60308cecebd171197322c49: exit status 255:
	error: invalid object 100644 4994770929b65b148f8d80e1ef0be9b50b9cc6c5 for ‘pkg/defines/proxy.go‘
	error: cannot read 4994770929b65b148f8d80e1ef0be9b50b9cc6c5
github.com/xxx/my_prj/proxy_alloc_svr/internal/endpoint/proxy imports
	github.com/xxx/my_prj/public/pkg/policy: git -c core.autocrlf=input -c core.eol=lf archive --format=zip --prefix=prefix/ d57403125286a6411e73163e184e2a88188a448d in C:\Users\ahfuzhang\go\pkg\mod\cache\vcs\1ae7172f3810140ab493892af4f3912f9d17b329d60308cecebd171197322c49: exit status 255:
	error: invalid object 100644 4994770929b65b148f8d80e1ef0be9b50b9cc6c5 for ‘pkg/defines/proxy.go‘
	error: cannot read 4994770929b65b148f8d80e1ef0be9b50b9cc6c5
github.com/xxx/my_prj/proxy_alloc_svr/pkg/filter imports
	github.com/xxx/my_prj/public/pkg/dao/proxy: git -c core.autocrlf=input -c core.eol=lf archive --format=zip --prefix=prefix/ d57403125286a6411e73163e184e2a88188a448d in C:\Users\ahfuzhang\go\pkg\mod\cache\vcs\1ae7172f3810140ab493892af4f3912f9d17b329d60308cecebd171197322c49: exit status 255:
	error: invalid object 100644 4994770929b65b148f8d80e1ef0be9b50b9cc6c5 for ‘pkg/defines/proxy.go‘
	error: cannot read 4994770929b65b148f8d80e1ef0be9b50b9cc6c5
github.com/xxx/my_prj/proxy_alloc_svr/pkg/utils imports
	github.com/xxx/my_prj/public/pkg/filter/tree: git -c core.autocrlf=input -c core.eol=lf archive --format=zip --prefix=prefix/ d57403125286a6411e73163e184e2a88188a448d in C:\Users\ahfuzhang\go\pkg\mod\cache\vcs\1ae7172f3810140ab493892af4f3912f9d17b329d60308cecebd171197322c49: exit status 255:
	error: invalid object 100644 4994770929b65b148f8d80e1ef0be9b50b9cc6c5 for ‘pkg/defines/proxy.go‘
	error: cannot read 4994770929b65b148f8d80e1ef0be9b50b9cc6c5

完全没有头绪。
尝试着删除临时目录后正常:

rm -fdr "C:\Users\ahfuzhang\go\pkg\mod\cache\vcs\1ae7172f3810140ab493892af4f3912f9d17b329d60308cecebd171197322c49"

【解决了一个小问题】golang build中因为缓存文件损坏导致的编译错误

标签:mat   lang   proxy   xxx   auto   过程   prefix   erro   缓存   

原文地址:https://www.cnblogs.com/ahfuzhang/p/14714764.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!