MCPcopy Create free account
hub / github.com/kataras/iris / GetApplication

Function GetApplication

context/application.go:186–198  ·  view source on GitHub ↗

GetApplication returns a registered Application based on its name. If the "appName" is not unique across Applications, then it will return the newest one.

(appName string)

Source from the content-addressed store, hash-verified

184// based on its name. If the "appName" is not unique
185// across Applications, then it will return the newest one.
186func GetApplication(appName string) (Application, bool) {
187 mu.RLock()
188
189 for i := len(registeredApps) - 1; i >= 0; i-- {
190 if app := registeredApps[i]; app != nil && app.String() == appName {
191 mu.RUnlock()
192 return app, true
193 }
194 }
195
196 mu.RUnlock()
197 return nil, false
198}
199
200// MustGetApplication same as `GetApplication` but it
201// panics if "appName" is not a registered Application's name.

Callers 3

hostAppFunction · 0.92
GetFunction · 0.92
MustGetApplicationFunction · 0.85

Calls 1

StringMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…