(ctx context.Context, target string)
| 46 | } |
| 47 | |
| 48 | func (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 | |
| 61 | func (i *imlCommitWithKeyService[T]) Save(ctx context.Context, target string, data *T) error { |
| 62 | return i.store.Save(ctx, target, data) |
nothing calls this directly
no test coverage detected