INNER CODE UNIT · Go

main

rameshsunkara/go-rest-api-example · main.go:25

func main() {
	if err := run(); err != nil {
		fmt.Fprintf(os.Stderr, "Service %s exited with error: %v (exit code: %d)\n",
			serviceName, err, exitCode(err))
		os.Exit(exitCode(err))
	}
}

func run() error {
	ctx, stop := signal.NotifyContext(context.Background(), os.Interrupt, syscall.SIGTERM, syscall.SIGINT)
	defer stop()

	// setup : read environmental configurations
	svcEnv, envErr := config.Load()
	if envErr != nil {
		return envErr
	}

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…