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

Function getExpansion

pkg/cmd/alias/set/set.go:165–176  ·  view source on GitHub ↗
(opts *SetOptions)

Source from the content-addressed store, hash-verified

163}
164
165func getExpansion(opts *SetOptions) (string, error) {
166 if opts.Expansion == "-" {
167 stdin, err := io.ReadAll(opts.IO.In)
168 if err != nil {
169 return "", fmt.Errorf("failed to read from STDIN: %w", err)
170 }
171
172 return string(stdin), nil
173 }
174
175 return opts.Expansion, nil
176}

Callers 2

setRunFunction · 0.85
TestGetExpansionFunction · 0.85

Calls 1

ErrorfMethod · 0.65

Tested by 1

TestGetExpansionFunction · 0.68