MCPcopy
hub / github.com/gin-gonic/gin / resolveAddress

Function resolveAddress

utils.go:147–161  ·  view source on GitHub ↗
(addr []string)

Source from the content-addressed store, hash-verified

145}
146
147func resolveAddress(addr []string) string {
148 switch len(addr) {
149 case 0:
150 if port := os.Getenv("PORT"); port != "" {
151 debugPrint("Environment variable PORT=\"%s\"", port)
152 return ":" + port
153 }
154 debugPrint("Environment variable PORT is undefined. Using port :8080 by default")
155 return ":8080"
156 case 1:
157 return addr[0]
158 default:
159 panic("too many parameters")
160 }
161}
162
163// https://stackoverflow.com/questions/53069040/checking-a-string-contains-only-ascii-characters
164func isASCII(s string) bool {

Callers 1

RunMethod · 0.85

Calls 1

debugPrintFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…