MCPcopy
hub / github.com/grafana/tempo / initConfig

Function initConfig

tools/chloggen/cmd/root.go:55–71  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

53}
54
55func initConfig() {
56 // Don't override if already set in tests
57 if globalCfg != nil {
58 return
59 }
60
61 if configFile == "" {
62 globalCfg = config.New(repoRoot())
63 } else {
64 var err error
65 globalCfg, err = config.NewFromFile(repoRoot(), configFile)
66 if err != nil {
67 fmt.Printf("FAIL: Could not load config file: %s\n", err.Error())
68 os.Exit(1)
69 }
70 }
71}
72
73func repoRoot() string {
74 dir, err := os.Getwd()

Callers

nothing calls this directly

Calls 4

NewFunction · 0.92
NewFromFileFunction · 0.92
repoRootFunction · 0.85
ErrorMethod · 0.65

Tested by

no test coverage detected