MCPcopy
hub / github.com/cli/cli / printHeaders

Function printHeaders

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

Source from the content-addressed store, hash-verified

589}
590
591func printHeaders(w io.Writer, headers http.Header, colorize bool) {
592 var names []string
593 for name := range headers {
594 if name == "Status" {
595 continue
596 }
597 names = append(names, name)
598 }
599 sort.Strings(names)
600
601 var headerColor, headerColorReset string
602 if colorize {
603 headerColor = "\x1b[1;34m" // bright blue
604 headerColorReset = "\x1b[m"
605 }
606 for _, name := range names {
607 fmt.Fprintf(w, "%s%s%s: %s\r\n", headerColor, name, headerColorReset, strings.Join(headers[name], ", "))
608 }
609}
610
611func openUserFile(fn string, stdin io.ReadCloser) (io.ReadCloser, int64, error) {
612 if fn == "-" {

Callers 1

processResponseFunction · 0.85

Calls 1

JoinMethod · 0.80

Tested by

no test coverage detected