MCPcopy Index your code
hub / github.com/cloudfoundry/cli / initI18nFunc

Function initI18nFunc

cf/commandregistry/registry.go:21–44  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

19var Commands = NewRegistry()
20
21func initI18nFunc() bool {
22 config, err := configv3.LoadConfig()
23
24 var configErrTemplate string
25 if err != nil {
26 if ce, ok := err.(translatableerror.EmptyConfigError); ok {
27 configErrTemplate = ce.Error()
28 } else {
29 fmt.Println(FailureColor("FAILED"))
30 fmt.Println("Error read/writing config: ", err.Error())
31 os.Exit(1)
32 }
33 }
34
35 T = Init(config)
36
37 if err != nil {
38 msg := T(configErrTemplate, map[string]interface{}{
39 "FilePath": configv3.ConfigFilePath(),
40 })
41 fmt.Fprintf(os.Stderr, "%s\n", msg)
42 }
43 return true
44}
45
46type registry struct {
47 cmd map[string]Command

Callers 1

registry.goFile · 0.85

Calls 7

LoadConfigFunction · 0.92
ConfigFilePathFunction · 0.92
FailureColorFunction · 0.85
InitFunction · 0.85
ErrorMethod · 0.65
PrintlnMethod · 0.65
ExitMethod · 0.65

Tested by

no test coverage detected