MCPcopy Index your code
hub / github.com/apache/answer / parsePgSQLHostPort

Function parsePgSQLHostPort

internal/install/install_req.go:93–107  ·  view source on GitHub ↗
(dbHost string)

Source from the content-addressed store, hash-verified

91}
92
93func parsePgSQLHostPort(dbHost string) (host string, port string) {
94 if strings.Contains(dbHost, ":") {
95 idx := strings.LastIndex(dbHost, ":")
96 host, port = dbHost[:idx], dbHost[idx+1:]
97 } else if len(dbHost) > 0 {
98 host = dbHost
99 }
100 if host == "" {
101 host = "127.0.0.1"
102 }
103 if port == "" {
104 port = "5432"
105 }
106 return host, port
107}
108
109// CheckDatabaseResp check database response
110type CheckDatabaseResp struct {

Callers 1

GetConnectionMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected