1
0
mirror of https://github.com/golang/go synced 2024-11-21 11:34:44 -07:00

Add errcheck when initializing default cache.

This commit is contained in:
Max Neverov 2024-11-21 07:34:59 +01:00
parent e0537d1088
commit 0684661728

View File

@ -35,7 +35,10 @@ See golang.org to learn more about Go.
// initDefaultCache does the work of finding the default cache
// the first time Default is called.
func initDefaultCache() Cache {
dir, _, _ := DefaultDir()
dir, _, err := DefaultDir()
if err != nil {
base.Fatalf("build cache is required, but could not be located: %v", err)
}
if dir == "off" {
if defaultDirErr != nil {
base.Fatalf("build cache is required, but could not be located: %v", defaultDirErr)