aboutsummaryrefslogtreecommitdiff
path: root/lib/websocket/funcs.go
diff options
context:
space:
mode:
authorShulhan <ms@kilabit.info>2026-04-05 03:50:32 +0700
committerShulhan <ms@kilabit.info>2026-04-05 03:52:47 +0700
commit778fd16011ec1d39c41b62372dc65f045183266e (patch)
treea6f6f26930c00d8ac3dd7bfa1fb476bd65454833 /lib/websocket/funcs.go
parent6fba7b9ce3bcaf4225e5ab774a15ef7364ed1420 (diff)
downloadpakakeh.go-778fd16011ec1d39c41b62372dc65f045183266e.tar.xz
all: apply go fix
Diffstat (limited to 'lib/websocket/funcs.go')
-rw-r--r--lib/websocket/funcs.go6
1 files changed, 1 insertions, 5 deletions
diff --git a/lib/websocket/funcs.go b/lib/websocket/funcs.go
index 293213a1..85c83eed 100644
--- a/lib/websocket/funcs.go
+++ b/lib/websocket/funcs.go
@@ -100,11 +100,7 @@ func Send(fd int, packet []byte, timeout time.Duration) (err error) {
}
for len(packet) > 0 {
- if len(packet) < maxBuffer {
- max = len(packet)
- } else {
- max = maxBuffer
- }
+ max = min(len(packet), maxBuffer)
n, err = unix.Write(fd, packet[:max])
if err != nil {