You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I came across this issue while googling for something similar. As the readme in both projects says, these projects directly track the upstream internal package which the Go authors have decided they will not move to a non-internal path. @victorboissiere I assume you've already solved this issue but for anyone else who may stumble across this, this is easy to impliment yourself with a small function to color the diff:
funccolorDiff(diffsstring) string {
green:="\x1b[32m"// green := "\x1b[48;5;194m" // if you prefer a light green backgroundred:="\x1b[31m"// red := ""\x1b[48;5;210m" // if you prefer a light red/pink backgroundreset:="\x1b[0m"// Reset to default terminal colorsvarcolorDiff strings.Builderlines:=strings.Split(diffs, "\n")
for_, line:=rangelines {
iflen(line) >0 {
switchstring(line[0]) {
case"-":
colorDiff.WriteString(red+line+reset+"\n")
case"+":
colorDiff.WriteString(green+line+reset+"\n")
default:
colorDiff.WriteString(line+"\n")
}
} else {
colorDiff.WriteString(line+"\n")
}
}
returncolorDiff.String()
}
The text was updated successfully, but these errors were encountered:
I came across this issue while googling for something similar. As the readme in both projects says, these projects directly track the upstream internal package which the Go authors have decided they will not move to a non-internal path. @victorboissiere I assume you've already solved this issue but for anyone else who may stumble across this, this is easy to impliment yourself with a small function to color the diff:
The text was updated successfully, but these errors were encountered: