lazyModelStore is the default ModelStore wired in when the caller did not pass WithModelStore. It defers constructing the modelsdev store (which calls os.UserHomeDir and creates the ~/.cagent cache directory) until the first method invocation. This keeps NewLocalRuntime free of disk I/O — tests that
| 24 | // Each runtime gets its own *Store; the per-runtime sync.Once only defers |
| 25 | // construction, it does not share catalog state across runtimes. |
| 26 | type lazyModelStore struct { |
| 27 | once sync.Once |
| 28 | st *modelsdev.Store |
| 29 | err error |
| 30 | } |
| 31 | |
| 32 | func (l *lazyModelStore) load() (*modelsdev.Store, error) { |
| 33 | l.once.Do(func() { |
nothing calls this directly
no outgoing calls
no test coverage detected