mirror of
https://github.com/goreleaser/goreleaser.git
synced 2025-03-19 20:57:53 +02:00
28 lines
525 B
Go
28 lines
525 B
Go
|
package main
|
||
|
|
||
|
import (
|
||
|
"context"
|
||
|
"fmt"
|
||
|
)
|
||
|
|
||
|
// Lint Goreleaser
|
||
|
func (g *Goreleaser) Lint(
|
||
|
ctx context.Context,
|
||
|
// Version of golangci-lint to use
|
||
|
// +default="v1.58.1"
|
||
|
golangciLintVersion string,
|
||
|
) (string, error) {
|
||
|
lintImage := fmt.Sprintf("golangci/golangci-lint:%s", golangciLintVersion)
|
||
|
return dag.Container().From(lintImage).
|
||
|
WithMountedDirectory("/src", g.Source).
|
||
|
WithWorkdir("/src").
|
||
|
WithExec([]string{
|
||
|
"golangci-lint",
|
||
|
"run",
|
||
|
"--config",
|
||
|
"./.golangci.yaml",
|
||
|
"./...",
|
||
|
}).
|
||
|
Stdout(ctx)
|
||
|
}
|