MCPcopy Index your code
hub / github.com/subtrace/subtrace / Format

Function Format

rpc/endpoint.go:25–33  ·  view source on GitHub ↗

Format takes a path and returns its URL. For example, given "/api/GetSelf", Format will return "https://subtrace.dev/api/GetSelf" as the URL. The SUBTRACE_ENDPOINT environment variable can be used to override the domain name used.

(path string)

Source from the content-addressed store, hash-verified

23// The SUBTRACE_ENDPOINT environment variable can be used to override the
24// domain name used.
25func Format(path string) string {
26 if path == "" {
27 path = "/"
28 }
29 if !strings.HasPrefix(path, "/") { // TODO: is this too relaxed?
30 path = "/" + path
31 }
32 return getEndpoint() + path
33}

Callers 1

CallFunction · 0.85

Calls 1

getEndpointFunction · 0.85

Tested by

no test coverage detected