NewApp creates a new instance of App.
()
| 324 | |
| 325 | // NewApp creates a new instance of App. |
| 326 | func NewApp() *App { |
| 327 | return &App{ |
| 328 | progress: &cliProgress{}, |
| 329 | cliStorageProviders: getRegisteredStorageProviders(), |
| 330 | |
| 331 | // testability hooks |
| 332 | exitWithError: func(err error) { |
| 333 | if err != nil { |
| 334 | os.Exit(1) |
| 335 | } |
| 336 | |
| 337 | os.Exit(0) |
| 338 | }, |
| 339 | stdoutWriter: colorable.NewColorableStdout(), |
| 340 | stderrWriter: colorable.NewColorableStderr(), |
| 341 | stdinReader: os.Stdin, |
| 342 | rootctx: context.Background(), |
| 343 | } |
| 344 | } |
| 345 | |
| 346 | // SetEnvNamePrefixForTesting sets the name prefix to be used for all environment variable names for testing. |
| 347 | func (c *App) SetEnvNamePrefixForTesting(prefix string) { |
no test coverage detected