aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFuwn <[email protected]>2025-05-24 10:28:46 +0000
committerFuwn <[email protected]>2025-05-24 10:28:46 +0000
commit7871452cbff49af3e7e015f0dac18d4bd2a9e064 (patch)
tree6845e2cfd31f1c80c4099fda58639e6a57a509e3
parentfeat(gigi.go): Emit connection write errors (diff)
downloadgigi-7871452cbff49af3e7e015f0dac18d4bd2a9e064.tar.xz
gigi-7871452cbff49af3e7e015f0dac18d4bd2a9e064.zip
refactor(gigi.go): Use ReplaceAll instead of Replace -1
-rw-r--r--gigi.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/gigi.go b/gigi.go
index 3b2d81a..eff800f 100644
--- a/gigi.go
+++ b/gigi.go
@@ -60,10 +60,10 @@ func handleConnection(connection net.Conn, mode int) {
return
}
- bufferContent := strings.Replace(
- strings.Replace(
- strings.Replace(string(connectionReadBuffer), "\x00", "", -1),
- "\n", "", -1), "\r", "", -1)
+ bufferContent := strings.ReplaceAll(
+ strings.ReplaceAll(
+ strings.ReplaceAll(string(connectionReadBuffer), "\x00", ""),
+ "\n", ""), "\r", "")
if len(bufferContent) == 0 {
bufferContent = "default"