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

Function printHeaders

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

Source from the content-addressed store, hash-verified

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

Callers 1

processResponseFunction · 0.85

Calls 1

JoinMethod · 0.80

Tested by

no test coverage detected