dongxian3852 2018-10-23 11:44
浏览 752
已采纳

在运行测试之前,如何自动清除Visual Code中的go缓存?

There is a small nuisance with Visual Code and Go, but is mainly related to the most recent release of go 1.11.x and the newly introduced module system. The go builder creates a folder called 'auto' for cached builds, which can be cleaned / deleted via 'go clean -cache'.

Visual Code seems to be confused when executing tests, if such a directory is present, and complains about missing dependencies:

/home/user/.golang/src/github.com/stretchr/testify/assert/assertions.go:20:2: could not import github.com/pmezard/go-difflib/difflib (open auto/4c/4cb1f0f2c9f328e3cade99998704759897fd4e530af38db25c85cdc253c1f1a0-d: no such file or directory)

is there any possibility to fix this? Or is it just another setting I forgot to make?

  • 写回答

2条回答 默认 最新

  • doujianwei8217 2018-10-23 12:32
    关注

    Try setting the environment variable GOCACHE=off.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 基于双目测规则物体尺寸
  • ¥15 wegame打不开英雄联盟
  • ¥15 公司的电脑,win10系统自带远程协助,访问家里个人电脑,提示出现内部错误,各种常规的设置都已经尝试,感觉公司对此功能进行了限制(我们是集团公司)
  • ¥15 救!ENVI5.6深度学习初始化模型报错怎么办?
  • ¥30 eclipse开启服务后,网页无法打开
  • ¥30 雷达辐射源信号参考模型
  • ¥15 html+css+js如何实现这样子的效果?
  • ¥15 STM32单片机自主设计
  • ¥15 如何在node.js中或者java中给wav格式的音频编码成sil格式呢
  • ¥15 不小心不正规的开发公司导致不给我们y码,