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

Function printHeaders

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

Source from the content-addressed store, hash-verified

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

Callers 1

processResponseFunction · 0.85

Calls 1

JoinMethod · 0.80

Tested by

no test coverage detected