MCPcopy
hub / github.com/docker/compose / ansiColorCode

Function ansiColorCode

cmd/formatter/colors.go:97–107  ·  view source on GitHub ↗

Everything about ansiColorCode color https://hyperskill.org/learn/step/18193

(code string, formatOpts ...string)

Source from the content-addressed store, hash-verified

95
96// Everything about ansiColorCode color https://hyperskill.org/learn/step/18193
97func ansiColorCode(code string, formatOpts ...string) string {
98 var sb strings.Builder
99 sb.WriteString("\033[")
100 for _, c := range formatOpts {
101 sb.WriteString(c)
102 sb.WriteString(";")
103 }
104 sb.WriteString(code)
105 sb.WriteString("m")
106 return sb.String()
107}
108
109func makeColorFunc(code string) colorFunc {
110 return func(s string) string {

Callers 1

ansiColorFunction · 0.85

Calls 1

StringMethod · 0.45

Tested by

no test coverage detected