Minor improvements.

This commit is contained in:
Oliver 2021-04-27 13:28:32 +02:00
parent ba9f3a6fa1
commit b610d436f3
2 changed files with 5 additions and 5 deletions

View File

@ -128,19 +128,19 @@ func (a *ansi) Write(text []byte) (int, error) {
for index, field := range fields { for index, field := range fields {
switch field { switch field {
case "1", "01": case "1", "01":
if strings.IndexRune(a.attributes, 'b') < 0 { if !strings.ContainsRune(a.attributes, 'b') {
a.attributes += "b" a.attributes += "b"
} }
case "2", "02": case "2", "02":
if strings.IndexRune(a.attributes, 'd') < 0 { if !strings.ContainsRune(a.attributes, 'd') {
a.attributes += "d" a.attributes += "d"
} }
case "4", "04": case "4", "04":
if strings.IndexRune(a.attributes, 'u') < 0 { if !strings.ContainsRune(a.attributes, 'u') {
a.attributes += "u" a.attributes += "u"
} }
case "5", "05": case "5", "05":
if strings.IndexRune(a.attributes, 'l') < 0 { if !strings.ContainsRune(a.attributes, 'l') {
a.attributes += "l" a.attributes += "l"
} }
case "22": case "22":

View File

@ -12,7 +12,7 @@ import (
) )
type company struct { type company struct {
Name string `json:name` Name string `json:"name"`
} }
func main() { func main() {