summaryrefslogtreecommitdiff
path: root/main.go
diff options
context:
space:
mode:
authortheimpostor <sahirhoda@gmail.com>2024-11-20 15:00:05 -0600
committertheimpostor <sahirhoda@gmail.com>2024-11-20 15:00:05 -0600
commitc5788706b13d641f4f8bfe70514e64a4f6deaf5f (patch)
tree4315e0704031a1f604acf6935516ef5775626042 /main.go
parentda8031e3df21bd20e09b5d600a0a0385e6ce4cc6 (diff)
fix panic send on closed channel
Diffstat (limited to 'main.go')
-rw-r--r--main.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/main.go b/main.go
index c1fac45..f0d359a 100644
--- a/main.go
+++ b/main.go
@@ -371,11 +371,11 @@ func paste() error {
// Time out initial read
readChan := make(chan readResult, 1)
- defer close(readChan)
go func() {
b, e := ttyReader.ReadSlice(';')
readChan <- readResult{data: b, err: e}
+ close(readChan)
}()
select {