MCPcopy
hub / github.com/dgraph-io/dgraph / interpretVFloatOrUid

Function interpretVFloatOrUid

worker/task.go:2211–2221  ·  view source on GitHub ↗
(val string)

Source from the content-addressed store, hash-verified

2209}
2210
2211func interpretVFloatOrUid(val string) ([]float32, uint64, error) {
2212 vf, err := types.ParseVFloat(val)
2213 if err == nil {
2214 return vf, 0, nil
2215 }
2216 uid, err := strconv.ParseUint(val, 0, 64)
2217 if err == nil {
2218 return nil, uid, nil
2219 }
2220 return nil, uid, errors.Errorf("Value %q is not a uid or vector", val)
2221}
2222
2223// ServeTask is used to respond to a query.
2224func (w *grpcWorker) ServeTask(ctx context.Context, q *pb.Query) (*pb.Result, error) {

Callers 1

parseSrcFnFunction · 0.85

Calls 2

ParseVFloatFunction · 0.92
ErrorfMethod · 0.45

Tested by

no test coverage detected