mirror of
https://github.com/onyx-and-iris/q3rcon.git
synced 2026-03-02 17:09:19 +00:00
remove removeColourCodes function
This commit is contained in:
parent
6d321aa816
commit
f552b96737
@ -48,6 +48,8 @@ func (f Flags) Validate() error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var reColourCodes = regexp.MustCompile(`\^[0-9]`)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
var exitCode int
|
var exitCode int
|
||||||
|
|
||||||
@ -252,13 +254,6 @@ func runCommand(ctx *context, cmd string) error {
|
|||||||
if ctx.sm.Running() {
|
if ctx.sm.Running() {
|
||||||
ctx.sm.Stop()
|
ctx.sm.Stop()
|
||||||
}
|
}
|
||||||
fmt.Print(removeColourCodes(resp))
|
fmt.Print(reColourCodes.ReplaceAllString(resp, ""))
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
var colourCodeRegex = regexp.MustCompile(`\^[0-9]`)
|
|
||||||
|
|
||||||
// removeColourCodes removes '\^[0-9]' colour codes from the input string.
|
|
||||||
func removeColourCodes(s string) string {
|
|
||||||
return colourCodeRegex.ReplaceAllString(s, "")
|
|
||||||
}
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user