// Code generated by go.wit.com/apps/autogenpb DO NOT EDIT. // go install go.wit.com/apps/autogenpb@latest // // This file was autogenerated with autogenpb: // autogenpb v0.5.25-2-g30e8de2 Built on 2025/10/16 09:16:09 ( 3 m) // Theese sort.pb.go and marshal.pb.go files are autogenerated // The autogenpb sources have example .proto files with instructions // package forgepb import ( "errors" "os" "path/filepath" "go.wit.com/lib/config" "go.wit.com/lib/env" "go.wit.com/log" ) func (f *Forge) configureCache(cacheName string) error { // construct the full file name fullname := config.MakeConfigFilename("forge", cacheName) // try to load the file f.cache = new(Cache) f.cache.Filename = fullname if env.Verbose() { log.Info("configCache() attempting to ReLoad()", fullname) } err := config.ReLoad(f.cache) if errors.Is(err, os.ErrNotExist) { // is a new file return os.ErrNotExist } if err != nil { log.Printf("patchesCacheLoad() failed err (%v) filename (%s)\n", err, f.cache.Filename) panic("failed to load patches") } if cacheName == "gosrc" { f.cache.Name = cacheName f.cache.Filename = fullname gosrc := filepath.Join(env.Get("homeDir"), "go/src") f.cache.Dirs = []string{gosrc} f.cache.Save() } env.SetGlobal("lib/forgepb", "cache", cacheName) env.SetGlobal("lib/forgepb", "cacheTEXT", f.cache.Filename) return err }