MCPcopy Create free account
hub / github.com/cli/cli / rest

Method rest

script/ghmock/checker.go:77–98  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

75}
76
77func (c *checker) rest() (*restIndex, error) {
78 c.restOnce.Do(func() {
79 path, err := restSource.locate(c.progress)
80 if err != nil {
81 c.restErr = err
82 return
83 }
84 data, err := os.ReadFile(path)
85 if err != nil {
86 c.restErr = err
87 return
88 }
89 idx, err := loadRESTIndex(data)
90 if err != nil {
91 c.restErr = fmt.Errorf("reading %s: %w", path, err)
92 return
93 }
94 c.restIdx = idx
95 c.restFile = newSchemaFile(restSource, path, data)
96 })
97 return c.restIdx, c.restErr
98}
99
100// preload loads both schemas before gh starts, so a first-time download
101// doesn't happen while gh waits for a response.

Callers 6

preloadMethod · 0.95
checkMethod · 0.95
schemaCheckFunction · 0.80
requireSchemasFunction · 0.80
scaffoldRESTFunction · 0.80
cmdSchemaFunction · 0.80

Calls 5

loadRESTIndexFunction · 0.85
newSchemaFileFunction · 0.85
locateMethod · 0.80
DoMethod · 0.65
ErrorfMethod · 0.65

Tested by

no test coverage detected