MCPcopy Index your code
hub / github.com/cli/cli / magicFieldValue

Function magicFieldValue

pkg/cmd/workflow/run/run.go:157–167  ·  view source on GitHub ↗

TODO MODIFIED copypasta from gh api

(v string, opts RunOptions)

Source from the content-addressed store, hash-verified

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