Fix unreachable code

This commit is contained in:
Yang Li 2018-11-18 04:16:25 +08:00
parent 8996fc1639
commit 267425667f
2 changed files with 1 additions and 3 deletions

View File

@ -397,7 +397,7 @@ func IsValidSocketAddr(value string) []string {
var errs []string
ip, port, err := net.SplitHostPort(value)
if err != nil {
return append(errs, "must be a valid socket address format, (e.g. 0.0.0.0:10254 or [::]:10254)")
errs = append(errs, "must be a valid socket address format, (e.g. 0.0.0.0:10254 or [::]:10254)")
return errs
}
portInt, _ := strconv.Atoi(port)

View File

@ -884,7 +884,6 @@ func TestFinishRequest(t *testing.T) {
timeout: time.Second,
fn: func() (runtime.Object, error) {
panic("my panic")
return nil, nil
},
expectedObj: nil,
expectedErr: nil,
@ -895,7 +894,6 @@ func TestFinishRequest(t *testing.T) {
timeout: time.Second,
fn: func() (runtime.Object, error) {
panic("my panic")
return nil, nil
},
expectedObj: nil,
expectedErr: nil,