Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我们在一个项目中使用 go modules 和 travis。每次 Travis 构建项目时,go modules 都会获取所有依赖项,这会增加构建时间。有什么方法可以减少时间或避免每次都获取 deps 吗?
是的,您可以缓存 Go 模块以加快构建过程。
- language: go script: - your script cache: directories: - $HOME/.cache/go-build # Cache the binaries - $HOME/gopath/pkg/mod # Cache the Go modules
参考:https ://restic.net/blog/2018-09-02/travis-build-cache