MCPcopy Create free account
hub / github.com/APIParkLab/APIPark / Latest

Method Latest

service/universally/commit/iml.go:48–59  ·  view source on GitHub ↗
(ctx context.Context, target string)

Source from the content-addressed store, hash-verified

46}
47
48func (i *imlCommitWithKeyService[T]) Latest(ctx context.Context, target string) (*Commit[T], error) {
49 list, err := i.ListLatest(ctx, target)
50 if err != nil {
51 return nil, err
52 }
53 if len(list) == 0 {
54 return nil, gorm.ErrRecordNotFound
55 }
56
57 result := list[0]
58 return result, nil
59}
60
61func (i *imlCommitWithKeyService[T]) Save(ctx context.Context, target string, data *T) error {
62 return i.store.Save(ctx, target, data)

Callers

nothing calls this directly

Calls 1

ListLatestMethod · 0.95

Tested by

no test coverage detected