INNER CODE UNIT · Go

parseIpFromAddr

feiyu563/PrometheusAlert · controllers/FlashDuty.go:38

func parseIpFromAddr(addr string) string {
	strs := strings.Split(addr, ":")
	if len(strs) == 2 {
		ip := net.ParseIP(strs[0])
		if ip != nil {
			return ip.String()
		}
	}

	return ""
}

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…