MCPcopy Create free account
hub / github.com/cloudwan/gohan / fetchContextHelper

Function fetchContextHelper

db/sql/sql.go:1117–1125  ·  view source on GitHub ↗
(list []*schema.Resource, err error, filter transaction.Filter)

Source from the content-addressed store, hash-verified

1115}
1116
1117func fetchContextHelper(list []*schema.Resource, err error, filter transaction.Filter) (*schema.Resource, error) {
1118 if err != nil {
1119 return nil, fmt.Errorf("Failed to fetch %s: %s", filter, err)
1120 }
1121 if len(list) < 1 {
1122 return nil, transaction.ErrResourceNotFound
1123 }
1124 return list[0], nil
1125}
1126
1127func (tx *Transaction) LockFetch(s *schema.Schema, filter transaction.Filter, lockPolicy schema.LockPolicy, options *transaction.ViewOptions) (*schema.Resource, error) {
1128 return tx.LockFetchContext(context.Background(), s, filter, lockPolicy, options)

Callers 2

FetchContextMethod · 0.85
FetchContextMethod · 0.85

Calls 1

ErrorfMethod · 0.65

Tested by

no test coverage detected