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

Function printHeaders

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

Source from the content-addressed store, hash-verified

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

Callers 1

processResponseFunction · 0.85

Calls 1

JoinMethod · 0.80

Tested by

no test coverage detected