MCPcopy
hub / github.com/cli/cli / FillFromJSON

Function FillFromJSON

pkg/cmd/pr/shared/state.go:63–77  ·  view source on GitHub ↗
(io *iostreams.IOStreams, recoverFile string, state *IssueMetadataState)

Source from the content-addressed store, hash-verified

61}
62
63func FillFromJSON(io *iostreams.IOStreams, recoverFile string, state *IssueMetadataState) error {
64 var data []byte
65 var err error
66 data, err = io.ReadUserFile(recoverFile)
67 if err != nil {
68 return fmt.Errorf("failed to read file %s: %w", recoverFile, err)
69 }
70
71 err = json.Unmarshal(data, state)
72 if err != nil {
73 return fmt.Errorf("JSON parsing failure: %w", err)
74 }
75
76 return nil
77}

Callers 1

createRunFunction · 0.92

Calls 2

ReadUserFileMethod · 0.80
ErrorfMethod · 0.65

Tested by

no test coverage detected