MCPcopy Create free account
hub / github.com/openclaw/gogcli / writeUnlocked

Method writeUnlocked

internal/docsbatch/repository.go:471–483  ·  view source on GitHub ↗
(state *State)

Source from the content-addressed store, hash-verified

469}
470
471func (r *Repository) writeUnlocked(state *State) error {
472 data, err := json.MarshalIndent(state, "", " ")
473 if err != nil {
474 return fmt.Errorf("encode batch: %w", err)
475 }
476
477 data = append(data, '\n')
478 if err := r.writeFile(r.path(state.BatchID), data, 0o600); err != nil {
479 return fmt.Errorf("write batch: %w", err)
480 }
481
482 return nil
483}
484
485func (r *Repository) path(batchID string) string {
486 return filepath.Join(r.dir, batchID+".json")

Callers 3

CreateMethod · 0.95
AppendMethod · 0.95
PersistOrDeleteMethod · 0.45

Calls 2

pathMethod · 0.95
ErrorfMethod · 0.80

Tested by

no test coverage detected