MCPcopy Create free account
hub / github.com/dagger/dagger / decodeJSON

Function decodeJSON

util/lockfile/lockfile.go:330–343  ·  view source on GitHub ↗
(data []byte, out any)

Source from the content-addressed store, hash-verified

328}
329
330func decodeJSON(data []byte, out any) error {
331 dec := json.NewDecoder(bytes.NewReader(data))
332 dec.UseNumber()
333 if err := dec.Decode(out); err != nil {
334 return err
335 }
336 if err := dec.Decode(&struct{}{}); err != io.EOF {
337 if err == nil {
338 return fmt.Errorf("unexpected trailing content")
339 }
340 return err
341 }
342 return nil
343}
344
345func entryKey(namespace, operation, inputsJSON string) tupleKey {
346 return tupleKey{

Callers 4

parseVersionHeaderFunction · 0.85
parseEntryFunction · 0.85
canonicalizeInputsFunction · 0.85
canonicalizeValueFunction · 0.85

Calls 1

DecodeMethod · 0.45

Tested by

no test coverage detected