diff --git a/README.md b/README.md index 9317546..6171eb1 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ and then match connections: // Create the main listener. l, err := net.Listen("tcp", ":23456") if err != nil { - log.Fatal(err) + panic(err) } // Create a cmux. diff --git a/example_recursive_test.go b/example_recursive_test.go index 3df3c85..0f5dbc6 100644 --- a/example_recursive_test.go +++ b/example_recursive_test.go @@ -4,7 +4,6 @@ import ( "crypto/rand" "crypto/tls" "fmt" - "log" "net" "net/http" "net/rpc" @@ -31,7 +30,7 @@ func tlsListener(l net.Listener) net.Listener { // Load certificates. certificate, err := tls.LoadX509KeyPair("cert.pem", "key.pem") if err != nil { - log.Fatal(err) + panic(err) } config := &tls.Config{ @@ -62,7 +61,7 @@ func Example_recursiveCmux() { // Create the TCP listener. l, err := net.Listen("tcp", "127.0.0.1:50051") if err != nil { - log.Fatal(err) + panic(err) } // Create a mux. diff --git a/example_test.go b/example_test.go index bcda8f3..d11e5a5 100644 --- a/example_test.go +++ b/example_test.go @@ -3,7 +3,6 @@ package cmux_test import ( "fmt" "io" - "log" "net" "net/http" "net/rpc" @@ -71,7 +70,7 @@ func serveGRPC(l net.Listener) { func Example() { l, err := net.Listen("tcp", "127.0.0.1:50051") if err != nil { - log.Fatal(err) + panic(err) } m := cmux.New(l) diff --git a/example_tls_test.go b/example_tls_test.go index 7f80303..562947e 100644 --- a/example_tls_test.go +++ b/example_tls_test.go @@ -4,7 +4,6 @@ import ( "crypto/rand" "crypto/tls" "fmt" - "log" "net" "net/http" @@ -28,7 +27,7 @@ func serveHTTPS(l net.Listener) { // Load certificates. certificate, err := tls.LoadX509KeyPair("cert.pem", "key.pem") if err != nil { - log.Fatal(err) + panic(err) } config := &tls.Config{ @@ -48,7 +47,7 @@ func Example_bothHTTPAndHTTPS() { // Create the TCP listener. l, err := net.Listen("tcp", "127.0.0.1:50051") if err != nil { - log.Fatal(err) + panic(err) } // Create a mux.