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

Function printHeaders

pkg/cmd/api/api.go:617–635  ·  view source on GitHub ↗
(w io.Writer, headers http.Header, colorize bool)

Source from the content-addressed store, hash-verified

615}
616
617func printHeaders(w io.Writer, headers http.Header, colorize bool) {
618 var names []string
619 for name := range headers {
620 if name == "Status" {
621 continue
622 }
623 names = append(names, name)
624 }
625 sort.Strings(names)
626
627 var headerColor, headerColorReset string
628 if colorize {
629 headerColor = "\x1b[1;34m" // bright blue
630 headerColorReset = "\x1b[m"
631 }
632 for _, name := range names {
633 fmt.Fprintf(w, "%s%s%s: %s\r\n", headerColor, name, headerColorReset, strings.Join(headers[name], ", "))
634 }
635}
636
637func openUserFile(fn string, stdin io.ReadCloser) (io.ReadCloser, int64, error) {
638 if fn == "-" {

Callers 1

processResponseFunction · 0.85

Calls 1

JoinMethod · 0.80

Tested by

no test coverage detected