MCPcopy
hub / github.com/caddyserver/caddy / Namespace

Method Namespace

modules.go:103–109  ·  view source on GitHub ↗

Namespace returns the namespace (or scope) portion of a module ID, which is all but the last label of the ID. If the ID has only one label, then the namespace is empty.

()

Source from the content-addressed store, hash-verified

101// which is all but the last label of the ID. If the ID has only one
102// label, then the namespace is empty.
103func (id ModuleID) Namespace() string {
104 lastDot := strings.LastIndex(string(id), ".")
105 if lastDot < 0 {
106 return ""
107 }
108 return string(id)[:lastDot]
109}
110
111// Name returns the Name (last element) of a module ID.
112func (id ModuleID) Name() string {

Callers 2

TestModuleIDFunction · 0.80
ServeHTTPMethod · 0.80

Calls

no outgoing calls

Tested by 1

TestModuleIDFunction · 0.64