golangcilint
No long description provided.
Installation
dagger install github.com/papercomputeco/daggerverse/golangcilint@b3469bf3e3d2ec5584b4ec62b33b0dc6243ae5c2Entrypoint
Return Type
Golangcilint !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| source | Directory | - | The Go source directory to lint. |
| config | File | - | An optional golangci-lint configuration file (.golangci.yml) that replaces the built-in opinionated defaults. |
| envVars | [String ! ] | - | Optional environment variables to set in the lint container. Each entry must be in "KEY=VALUE" format (e.g. "GOEXPERIMENT=rangefunc"). |
| baseCtr | Container | - | Optional base container with golangci-lint already installed. When provided it replaces the default golangci-lint image, allowing callers to supply extra system libraries or tooling (e.g. sqlite-dev). The container must have golangci-lint on PATH. |
Example
dagger -m github.com/papercomputeco/daggerverse/golangcilint@b3469bf3e3d2ec5584b4ec62b33b0dc6243ae5c2 call \
func (m *MyModule) Example() *dagger.Golangcilint {
return dag.
Golangcilint()
}@function
def example() -> dagger.Golangcilint:
return (
dag.golangcilint()
)@func()
example(): Golangcilint {
return dag
.golangcilint()
}Types
Golangcilint 🔗
lint() 🔗
Lint runs golangci-lint on the source directory with –fix, applying auto-fixes where possible, and returns the directory with fixes applied.
Return Type
Directory ! Example
dagger -m github.com/papercomputeco/daggerverse/golangcilint@b3469bf3e3d2ec5584b4ec62b33b0dc6243ae5c2 call \
lintfunc (m *MyModule) Example() *dagger.Directory {
return dag.
Golangcilint().
Lint()
}@function
def example() -> dagger.Directory:
return (
dag.golangcilint()
.lint()
)@func()
example(): Directory {
return dag
.golangcilint()
.lint()
}check() 🔗
Check runs golangci-lint on the source directory without applying fixes. It returns the linter output as a string. If there are lint violations the Dagger pipeline will fail, making this suitable for CI checks.
Return Type
String ! Example
dagger -m github.com/papercomputeco/daggerverse/golangcilint@b3469bf3e3d2ec5584b4ec62b33b0dc6243ae5c2 call \
checkfunc (m *MyModule) Example(ctx context.Context) string {
return dag.
Golangcilint().
Check(ctx)
}@function
async def example() -> str:
return await (
dag.golangcilint()
.check()
)@func()
async example(): Promise<string> {
return dag
.golangcilint()
.check()
}