Error Handling

The ? operator simplifies Go's if err != nil { return err } pattern. Place ? after a call that returns an error to propagate it automatically. The enclosing function must return error for this to work.

Add a block after ? to customise error handling. Name the error with ? err { ... } to wrap it with context.

Try it: Change parsePort("8080") to parsePort("") to trigger an error.