1
0
mirror of https://github.com/golang/go synced 2024-11-24 23:57:57 -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 // initDefaultCache does the work of finding the default cache
// the first time Default is called. // the first time Default is called.
func initDefaultCache() Cache { 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 dir == "off" {
if defaultDirErr != nil { if defaultDirErr != nil {
base.Fatalf("build cache is required, but could not be located: %v", defaultDirErr) base.Fatalf("build cache is required, but could not be located: %v", defaultDirErr)