Update vendor with go dep
This fix updates vendor with `go dep` Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
This commit is contained in:
parent
e08fb277fa
commit
6e3be7f3d5
8538 changed files with 2537051 additions and 81115 deletions
24
vendor/github.com/go-openapi/swag/net.go
generated
vendored
Normal file
24
vendor/github.com/go-openapi/swag/net.go
generated
vendored
Normal file
|
@ -0,0 +1,24 @@
|
|||
package swag
|
||||
|
||||
import (
|
||||
"net"
|
||||
"strconv"
|
||||
)
|
||||
|
||||
// SplitHostPort splits a network address into a host and a port.
|
||||
// The port is -1 when there is no port to be found
|
||||
func SplitHostPort(addr string) (host string, port int, err error) {
|
||||
h, p, err := net.SplitHostPort(addr)
|
||||
if err != nil {
|
||||
return "", -1, err
|
||||
}
|
||||
if p == "" {
|
||||
return "", -1, &net.AddrError{Err: "missing port in address", Addr: addr}
|
||||
}
|
||||
|
||||
pi, err := strconv.Atoi(p)
|
||||
if err != nil {
|
||||
return "", -1, err
|
||||
}
|
||||
return h, pi, nil
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue