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)
| 184 | // based on its name. If the "appName" is not unique |
| 185 | // across Applications, then it will return the newest one. |
| 186 | func 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. |
no test coverage detected
searching dependent graphs…