MCPcopy Create free account
hub / github.com/1Panel-dev/1Panel / formatWithFallback

Function formatWithFallback

agent/utils/alert/alert.go:573–584  ·  view source on GitHub ↗
(value string, fallback func() string)

Source from the content-addressed store, hash-verified

571}
572
573func formatWithFallback(value string, fallback func() string) string {
574 value = strings.TrimSpace(value)
575 if value == "" {
576 value = strings.TrimSpace(fallback())
577 }
578
579 if value == "" {
580 return ""
581 }
582
583 return fmt.Sprintf("「%s」", value)
584}
585
586func getFallbackHostname() string {
587 hostInfo, err := psutil.HOST.GetHostInfo(false)

Callers 2

getNodeNameFunction · 0.85
getNodeIpFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected