code: func (m *Main) Run() error {
  	// Open HTTP port.
  	ln, err := net.Listen("tcp", m.Addr)
  	if err != nil {
  		return err
  	}
  	m.ln = ln
  
  	// Initialize handler logger.
  	m.Handler.Logger = m.Logger.New("component", "http")
  
  	// Register service with discoverd.
  	hb, err := discoverd.AddServiceAndRegister(m.ServiceName+"-api", m.Addr)
  	if err != nil {
  		return err
  	}
  	shutdown.BeforeExit(func() { hb.Close() })
  
  	h := httphelper.ContextInjector(m.ServiceName+"-api", httphelper.NewRequestLogger(m.Handler))
  	go func() { http.Serve(ln, h) }()
  
  	return nil
  }
docs: // Run executes the program.