MCPcopy
hub / github.com/caddyserver/caddy / Main

Function Main

cmd/main.go:66–79  ·  view source on GitHub ↗

Main implements the main function of the caddy command. Call this if Caddy is to be the main() of your program.

()

Source from the content-addressed store, hash-verified

64// Main implements the main function of the caddy command.
65// Call this if Caddy is to be the main() of your program.
66func Main() {
67 if len(os.Args) == 0 {
68 fmt.Printf("[FATAL] no arguments provided by OS; args[0] must be command\n")
69 os.Exit(caddy.ExitCodeFailedStartup)
70 }
71
72 if err := defaultFactory.Build().Execute(); err != nil {
73 var exitError *exitError
74 if errors.As(err, &exitError) {
75 os.Exit(exitError.ExitCode)
76 }
77 os.Exit(1)
78 }
79}
80
81// handlePingbackConn reads from conn and ensures it matches
82// the bytes in expect, or returns an error if it doesn't.

Callers

nothing calls this directly

Calls 2

ExecuteMethod · 0.80
BuildMethod · 0.80

Tested by

no test coverage detected