golangci-lint/pkg/commands/executor.go
2018-05-13 19:20:42 +03:00

31 lines
391 B
Go

package commands
import (
"github.com/golangci/golangci-lint/pkg/config"
"github.com/spf13/cobra"
)
type Executor struct {
rootCmd *cobra.Command
cfg *config.Config
exitCode int
}
func NewExecutor() *Executor {
e := &Executor{
cfg: &config.Config{},
}
e.initRoot()
e.initRun()
e.initLinters()
return e
}
func (e Executor) Execute() error {
return e.rootCmd.Execute()
}