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

Function magicFieldValue

pkg/cmd/workflow/run/run.go:158–168  ·  view source on GitHub ↗

TODO MODIFIED copypasta from gh api

(v string, opts RunOptions)

Source from the content-addressed store, hash-verified

156
157// TODO MODIFIED copypasta from gh api
158func magicFieldValue(v string, opts RunOptions) (string, error) {
159 if strings.HasPrefix(v, "@") {
160 fileBytes, err := opts.IO.ReadUserFile(v[1:])
161 if err != nil {
162 return "", err
163 }
164 return string(fileBytes), nil
165 }
166
167 return v, nil
168}
169
170// TODO copypasta from gh api
171func parseFields(opts RunOptions) (map[string]string, error) {

Callers 2

parseFieldsFunction · 0.70
Test_magicFieldValueFunction · 0.70

Calls 1

ReadUserFileMethod · 0.80

Tested by 1

Test_magicFieldValueFunction · 0.56