MCPcopy
hub / github.com/EverythingSuckz/TG-FileStreamBot / getIP

Function getIP

config/config.go:236–251  ·  view source on GitHub ↗
(public bool)

Source from the content-addressed store, hash-verified

234}
235
236func getIP(public bool) (string, error) {
237 var ip string
238 var err error
239 if public {
240 ip, err = GetPublicIP()
241 } else {
242 ip, err = getInternalIP()
243 }
244 if ip == "" {
245 ip = "localhost"
246 }
247 if err != nil {
248 return "localhost", err
249 }
250 return ip, nil
251}
252
253// https://stackoverflow.com/a/23558495/15807350
254func getInternalIP() (string, error) {

Callers 1

setupEnvVarsMethod · 0.85

Calls 2

GetPublicIPFunction · 0.85
getInternalIPFunction · 0.85

Tested by

no test coverage detected