fix lint issues

This commit is contained in:
Naitik Shah 2013-11-07 10:01:43 -08:00
parent fea22b9055
commit ae84a7ab31

View File

@ -22,17 +22,16 @@ var (
errNoStartedListeners = errors.New("no started listeners") errNoStartedListeners = errors.New("no started listeners")
) )
// Defines an application containing various servers and associated // An App contains one or more servers and associated configuration.
// configuration.
type App struct { type App struct {
Servers []*http.Server Servers []*http.Server
listeners []grace.Listener listeners []grace.Listener
errors chan error errors chan error
} }
// Inherit or create new listeners. Returns a bool indicating if we inherited // Listen will inherit or create new listeners. Returns a bool indicating if we
// listeners. This return value is useful in order to decide if we should // inherited listeners. This return value is useful in order to decide if we
// instruct the parent process to terminate. // should instruct the parent process to terminate.
func (a *App) Listen() (bool, error) { func (a *App) Listen() (bool, error) {
var err error var err error
a.errors = make(chan error, len(a.Servers)) a.errors = make(chan error, len(a.Servers))
@ -48,7 +47,7 @@ func (a *App) Listen() (bool, error) {
} }
return false, nil return false, nil
} }
return false, fmt.Errorf("Failed graceful handoff: %s", err) return false, fmt.Errorf("failed graceful handoff: %s", err)
} }
// Creates new listeners (as in not inheriting) for all the configured Servers. // Creates new listeners (as in not inheriting) for all the configured Servers.
@ -131,7 +130,7 @@ func Serve(servers ...*http.Server) error {
// Close the parent if we inherited and it wasn't init that started us. // Close the parent if we inherited and it wasn't init that started us.
if inherited && os.Getppid() != 1 { if inherited && os.Getppid() != 1 {
if err := grace.CloseParent(); err != nil { if err := grace.CloseParent(); err != nil {
return fmt.Errorf("Failed to close parent: %s", err) return fmt.Errorf("failed to close parent: %s", err)
} }
} }