Skip to content

Commit a4bb57d

Browse files
author
lixizan
committed
delete unused code
1 parent fffc268 commit a4bb57d

File tree

2 files changed

+4
-16
lines changed

2 files changed

+4
-16
lines changed

Makefile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,7 @@ build:
99

1010
run-testsuite-server:
1111
go run github.com/lxzan/gws/examples/testsuite
12+
13+
coverage:
14+
go test -v $(go list ./... |grep -v /cmd |grep -v /vendor) -coverprofile=bin/coverage.out
15+

internal/error.go

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -87,22 +87,6 @@ func (c StatusCode) Error() string {
8787
return "gws: " + closeErrorMap[c]
8888
}
8989

90-
func (c StatusCode) ToClientCode() StatusCode {
91-
if !(c == 1000 || (c >= 3000 && c < 5000)) {
92-
if c < 1000 || (c >= 1016 && c < 3000) {
93-
return CloseProtocolError
94-
} else {
95-
switch c {
96-
case 1004, 1005, 1006, 1014:
97-
return CloseProtocolError
98-
default:
99-
return 1000
100-
}
101-
}
102-
}
103-
return c
104-
}
105-
10690
func NewError(code StatusCode, err error) *Error {
10791
return &Error{Code: code, Err: err}
10892
}

0 commit comments

Comments
 (0)