MCPcopy Create free account
hub / github.com/easyp-tech/server / splitOwnerModule

Function splitOwnerModule

internal/connect/commits.go:1102–1108  ·  view source on GitHub ↗

splitOwnerModule splits an infoCache key of the form "owner/module" back into its parts. Returns ok=false if the key is malformed (no slash or empty parts). The owner part may itself contain a slash for some deploy topologies, so we split on the FIRST slash and treat the rest as module.

(key string)

Source from the content-addressed store, hash-verified

1100// empty parts). The owner part may itself contain a slash for some deploy
1101// topologies, so we split on the FIRST slash and treat the rest as module.
1102func splitOwnerModule(key string) (owner, module string, ok bool) {
1103 idx := strings.IndexByte(key, '/')
1104 if idx <= 0 || idx == len(key)-1 {
1105 return "", "", false
1106 }
1107 return key[:idx], key[idx+1:], true
1108}
1109
1110// ServeGetModules handles v1/v1beta1 ModuleService/GetModules.
1111func (h *commitServiceHandler) ServeGetModules(w http.ResponseWriter, r *http.Request) {

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected