(s string)
| 109 | } |
| 110 | |
| 111 | func stripANSI(s string) string { |
| 112 | var b strings.Builder |
| 113 | inEscape := false |
| 114 | for i := 0; i < len(s); i++ { |
| 115 | ch := s[i] |
| 116 | if inEscape { |
| 117 | if ch >= '@' && ch <= '~' { |
| 118 | inEscape = false |
| 119 | } |
| 120 | continue |
| 121 | } |
| 122 | if ch == 0x1b { |
| 123 | inEscape = true |
| 124 | continue |
| 125 | } |
| 126 | b.WriteByte(ch) |
| 127 | } |
| 128 | return b.String() |
| 129 | } |
no outgoing calls
no test coverage detected