mirror of
https://github.com/soheilhy/cmux.git
synced 2025-01-19 03:06:07 +08:00
golint
cmux.go:28:1: exported method ErrNotMatched.Temporary should have comment or be unexported cmux.go:29:1: exported method ErrNotMatched.Timeout should have comment or be unexported cmux.go:38:2: exported var ErrListenerClosed should have comment or be unexported cmux.go:165:6: exported type MuxConn should have comment or be unexported
This commit is contained in:
parent
05566d752e
commit
48deeb47a3
@ -3,3 +3,9 @@ language: go
|
||||
go:
|
||||
- 1.3
|
||||
- 1.4
|
||||
|
||||
before_install:
|
||||
- go get -u github.com/golang/lint/golint
|
||||
|
||||
before_script:
|
||||
- golint ./...
|
||||
|
8
cmux.go
8
cmux.go
@ -13,6 +13,8 @@ type Matcher func(r io.Reader) (ok bool)
|
||||
// the mux should continue serving the listener.
|
||||
type ErrorHandler func(err error) (ok bool)
|
||||
|
||||
var _ net.Error = ErrNotMatched{}
|
||||
|
||||
// ErrNotMatched is returned whenever a connection is not matched by any of
|
||||
// the matchers registered in the multiplexer.
|
||||
type ErrNotMatched struct {
|
||||
@ -24,7 +26,10 @@ func (e ErrNotMatched) Error() string {
|
||||
e.c.RemoteAddr())
|
||||
}
|
||||
|
||||
// Temporary implements the net.Error interface.
|
||||
func (e ErrNotMatched) Temporary() bool { return true }
|
||||
|
||||
// Timeout implements the net.Error interface.
|
||||
func (e ErrNotMatched) Timeout() bool { return false }
|
||||
|
||||
type errListenerClosed string
|
||||
@ -34,6 +39,8 @@ func (e errListenerClosed) Temporary() bool { return false }
|
||||
func (e errListenerClosed) Timeout() bool { return false }
|
||||
|
||||
var (
|
||||
// ErrListenerClosed is returned from muxListener.Accept when the underlying
|
||||
// listener is closed.
|
||||
ErrListenerClosed = errListenerClosed("mux: listener closed")
|
||||
)
|
||||
|
||||
@ -157,6 +164,7 @@ func (l muxListener) Accept() (c net.Conn, err error) {
|
||||
}
|
||||
}
|
||||
|
||||
// MuxConn wraps a net.Conn and provides transparent sniffing of connection data.
|
||||
type MuxConn struct {
|
||||
net.Conn
|
||||
buf buffer
|
||||
|
Loading…
Reference in New Issue
Block a user