-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathregister.go
More file actions
34 lines (29 loc) · 917 Bytes
/
register.go
File metadata and controls
34 lines (29 loc) · 917 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
package gorunner
import (
"quitsh-cli/pkg/runner/config"
"github.com/sdsc-ordes/quitsh/pkg/component/step"
"github.com/sdsc-ordes/quitsh/pkg/errors"
"github.com/sdsc-ordes/quitsh/pkg/log"
"github.com/sdsc-ordes/quitsh/pkg/runner"
"github.com/sdsc-ordes/quitsh/pkg/runner/factory"
)
// Register registers the runners in the factory.
func Register(
lintSettings *config.LintSettings,
factory factory.IFactory,
) (err error) {
log.Trace("Register runner.", "id", GoLintRunnerID)
e := factory.Register(
GoLintRunnerID,
runner.RunnerData{
Creator: func(config step.AuxConfig) (runner.IRunner, error) {
return NewGoLintRunner(config, lintSettings)
},
RunnerConfigUnmarshal: UnmarshalLintConfig,
DefaultToolchain: "lint-go",
})
err = errors.Combine(err, e)
e = factory.RegisterToKey(runner.NewRegisterKey("lint", "go"), GoLintRunnerID)
err = errors.Combine(err, e)
return err
}