mirror of
https://github.com/soheilhy/cmux.git
synced 2024-11-10 03:31:52 +08:00
Fix lint errors in cmux_test.go
This commit is contained in:
parent
861c99e0fc
commit
3ac8d3a667
10
cmux_test.go
10
cmux_test.go
@ -188,8 +188,8 @@ func runTestRPCClient(t *testing.T, addr net.Addr) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const (
|
const (
|
||||||
handleHttp1Close = 1
|
handleHTTP1Close = 1
|
||||||
handleHttp1Request = 2
|
handleHTTP1Request = 2
|
||||||
handleAnyClose = 3
|
handleAnyClose = 3
|
||||||
handleAnyRequest = 4
|
handleAnyRequest = 4
|
||||||
)
|
)
|
||||||
@ -210,11 +210,11 @@ func TestTimeout(t *testing.T) {
|
|||||||
go func() {
|
go func() {
|
||||||
con, err := http1.Accept()
|
con, err := http1.Accept()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
result <- handleHttp1Close
|
result <- handleHTTP1Close
|
||||||
} else {
|
} else {
|
||||||
_, _ = con.Write([]byte("http1"))
|
_, _ = con.Write([]byte("http1"))
|
||||||
_ = con.Close()
|
_ = con.Close()
|
||||||
result <- handleHttp1Request
|
result <- handleHTTP1Request
|
||||||
}
|
}
|
||||||
}()
|
}()
|
||||||
go func() {
|
go func() {
|
||||||
@ -260,7 +260,7 @@ func TestTimeout(t *testing.T) {
|
|||||||
if a := <-result; a != handleAnyRequest {
|
if a := <-result; a != handleAnyRequest {
|
||||||
t.Fatal("testTimeout failed: any rule did not match")
|
t.Fatal("testTimeout failed: any rule did not match")
|
||||||
}
|
}
|
||||||
if a := <-result; a != handleHttp1Close {
|
if a := <-result; a != handleHTTP1Close {
|
||||||
t.Fatal("testTimeout failed: no close an http rule")
|
t.Fatal("testTimeout failed: no close an http rule")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user