MCPcopy Create free account
hub / github.com/git-bug/git-bug / ClockLoader

Function ClockLoader

entity/dag/clock.go:12–32  ·  view source on GitHub ↗

ClockLoader is the repository.ClockLoader for Entity

(defs ...Definition)

Source from the content-addressed store, hash-verified

10
11// ClockLoader is the repository.ClockLoader for Entity
12func ClockLoader(defs ...Definition) repository.ClockLoader {
13 clocks := make([]string, 0, len(defs)*2)
14 for _, def := range defs {
15 clocks = append(clocks, fmt.Sprintf(creationClockPattern, def.Namespace))
16 clocks = append(clocks, fmt.Sprintf(editClockPattern, def.Namespace))
17 }
18
19 return repository.ClockLoader{
20 Clocks: clocks,
21 Witnesser: func(repo repository.ClockedRepo) error {
22 var errG errgroup.Group
23 for _, def := range defs {
24 def := def
25 errG.Go(func() error {
26 return ReadAllClocksNoCheck(def, repo)
27 })
28 }
29 return errG.Wait()
30 },
31 }
32}

Callers 1

bug.goFile · 0.92

Calls 3

ReadAllClocksNoCheckFunction · 0.85
GoMethod · 0.80
WaitMethod · 0.80

Tested by

no test coverage detected