INNER CODE UNIT · Go

main

LerianStudio/midaz · components/tracer/cmd/app/main.go:32

func main() {
	buildinfo.Set(buildinfo.Build{Version: version, Revision: revision, BuildTime: buildTime})
	buildinfo.HandleFlag() // "--version" prints the identity as JSON and exits 0

	if err := run(); err != nil {
		// Print to stderr — logger may not be wired yet at this point.
		fmt.Fprintf(os.Stderr, "tracer: fatal: %v\n", err)
		os.Exit(1)
	}
}

// run is the actual entry point. Extracted from main so we can return an
// error and exit cleanly via os.Exit instead of panicking. Panics in main
// skip deferred functions in libraries that wired teardown via init() —
// returning is the safer pattern.
func run() error {
	pkg.InitLocalEnvConfig()

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…