Ignore EOF

This commit is contained in:
Bryce Lampe
2024-04-17 12:27:03 -07:00
parent 43979f6d93
commit b9a801e8ae

View File

@@ -2,6 +2,8 @@ package examples
import ( import (
"crypto/rsa" "crypto/rsa"
"errors"
"io"
"math/rand" "math/rand"
"net" "net"
"os" "os"
@@ -44,12 +46,14 @@ func sshagent() string {
} }
go func() { go func() {
conn, err := l.Accept() for {
if err != nil { conn, err := l.Accept()
panic(err) if err != nil {
} panic(err)
if err := agent.ServeAgent(a, conn); err != nil { }
panic(err) if err := agent.ServeAgent(a, conn); err != nil && !errors.Is(err, io.EOF) {
panic(err)
}
} }
}() }()