MCPcopy
hub / github.com/jackc/pgx / parsePort

Function parsePort

pgconn/config.go:967–976  ·  view source on GitHub ↗
(s string)

Source from the content-addressed store, hash-verified

965}
966
967func parsePort(s string) (uint16, error) {
968 port, err := strconv.ParseUint(s, 10, 16)
969 if err != nil {
970 return 0, err
971 }
972 if port < 1 || port > math.MaxUint16 {
973 return 0, errors.New("outside range")
974 }
975 return uint16(port), nil
976}
977
978func makeDefaultDialer() *net.Dialer {
979 // rely on GOLANG KeepAlive settings

Callers 1

ParseConfigWithOptionsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected