A lightweight test helper package
0

Configure Feed

Select the types of activity you want to include in your feed.

Update a gopls modernizer recommendation (#79)

* Update a gopls modernizer recommendation

* Use hue's Text method for slightly faster colouring

authored by

Tom Fleet and committed by
GitHub
(Aug 25, 2025, 8:56 AM +0100) f84e2c2b 1dd0afc4

+4 -4
+4 -4
test.go
··· 491 491 // prettyDiff takes a string diff in unified diff format and colourises it for easier viewing. 492 492 func prettyDiff(diff string) string { 493 493 lines := strings.Split(diff, "\n") 494 - for i := 0; i < len(lines); i++ { 494 + for i := range lines { 495 495 trimmed := strings.TrimSpace(lines[i]) 496 496 if strings.HasPrefix(trimmed, "---") || strings.HasPrefix(trimmed, "- ") { 497 - lines[i] = red.Sprint(lines[i]) 497 + lines[i] = red.Text(lines[i]) 498 498 } 499 499 500 500 if strings.HasPrefix(trimmed, "@@") { 501 - lines[i] = header.Sprint(lines[i]) 501 + lines[i] = header.Text(lines[i]) 502 502 } 503 503 504 504 if strings.HasPrefix(trimmed, "+++") || strings.HasPrefix(trimmed, "+ ") { 505 - lines[i] = green.Sprint(lines[i]) 505 + lines[i] = green.Text(lines[i]) 506 506 } 507 507 } 508 508