From 17892513d0a0576370b8f5e109bed043bc39fa11 Mon Sep 17 00:00:00 2001 From: Alexandre Thenorio Date: Mon, 28 Mar 2022 17:50:10 +0200 Subject: [PATCH] feat(golangci-lint): expose default config Expose the default golangci-lint config to be used by other projects who want to run the `Command()` but still want to benefit from the default configuration --- tools/sggolangcilint/tools.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/sggolangcilint/tools.go b/tools/sggolangcilint/tools.go index 9109d27b..ee7b4cc6 100644 --- a/tools/sggolangcilint/tools.go +++ b/tools/sggolangcilint/tools.go @@ -21,7 +21,7 @@ const ( ) //go:embed golangci.yml -var defaultConfig []byte +var DefaultConfig []byte func Command(ctx context.Context, args ...string) *exec.Cmd { sg.Deps(ctx, PrepareCommand) @@ -34,7 +34,7 @@ func Run(ctx context.Context, args ...string) error { if err := os.MkdirAll(filepath.Dir(defaultConfigPath), 0o755); err != nil { return err } - if err := os.WriteFile(defaultConfigPath, defaultConfig, 0o600); err != nil { + if err := os.WriteFile(defaultConfigPath, DefaultConfig, 0o600); err != nil { return err } var commands []*exec.Cmd