golangci-lint
Fast linters runner for Go.
Installation
dagger install github.com/sagikazarmark/daggerverse/golangci-lint@v0.9.0Entrypoint
Return Type
GolangciLint !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| version | String | - | Version (image tag) to use from the official image repository as a golangci-lint binary source. |
| binary | File | - | golangci-lint binary. |
| disableCache | Boolean | - | Disable mounting default cache volumes. |
| cache | CacheVolume | - | Linter cache volume to mount (takes precedence over disableCache). |
| goVersion | String | - | Version (image tag) to use from the official image repository as a Go base container. |
| container | Container | - | Custom container to use as a base container. MUST include Go and any other dependencies required to build the project. Takes precedence over goVersion. |
Example
dagger -m github.com/sagikazarmark/daggerverse/golangci-lint@e6c14178bcaaff9e102e2a89173ca31479b80629 call \
func (m *MyModule) Example() *dagger.GolangciLint {
return dag.
GolangciLint()
}@function
def example() -> dagger.GolangciLint:
return (
dag.golangci_lint()
)@func()
example(): GolangciLint {
return dag
.golangciLint()
}Types
GolangciLint 🔗
binary() 🔗
Return Type
File ! Example
dagger -m github.com/sagikazarmark/daggerverse/golangci-lint@e6c14178bcaaff9e102e2a89173ca31479b80629 call \
binaryfunc (m *MyModule) Example() *dagger.File {
return dag.
GolangciLint().
Binary()
}@function
def example() -> dagger.File:
return (
dag.golangci_lint()
.binary()
)@func()
example(): File {
return dag
.golangciLint()
.binary()
}container() 🔗
Return Type
Container ! Example
dagger -m github.com/sagikazarmark/daggerverse/golangci-lint@e6c14178bcaaff9e102e2a89173ca31479b80629 call \
containerfunc (m *MyModule) Example() *dagger.Container {
return dag.
GolangciLint().
Container()
}@function
def example() -> dagger.Container:
return (
dag.golangci_lint()
.container()
)@func()
example(): Container {
return dag
.golangciLint()
.container()
}withCache() 🔗
Mount a cache volume for golangci-lint cache.
Return Type
GolangciLint !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| cache | CacheVolume ! | - | No description provided |
| source | Directory | - | Identifier of the directory to use as the cache volume's root. |
| sharing | Enum | - | Sharing mode of the cache volume. |
Example
dagger -m github.com/sagikazarmark/daggerverse/golangci-lint@e6c14178bcaaff9e102e2a89173ca31479b80629 call \
with-cache --cache VOLUME_NAMEfunc (m *MyModule) Example(cache *dagger.CacheVolume) *dagger.GolangciLint {
return dag.
GolangciLint().
WithCache(cache)
}@function
def example(cache: dagger.CacheVolume) -> dagger.GolangciLint:
return (
dag.golangci_lint()
.with_cache(cache)
)@func()
example(cache: CacheVolume): GolangciLint {
return dag
.golangciLint()
.withCache(cache)
}run() 🔗
Run the linters.
Return Type
Container !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| source | Directory ! | - | No description provided |
| config | File | - | Read custom configuration file. |
| timeout | String | - | Timeout for total work. |
| verbose | Boolean | - | Verbose output. |
| rawArgs | [String ! ] | - | Additional arguments to pass to the command. |
Example
dagger -m github.com/sagikazarmark/daggerverse/golangci-lint@e6c14178bcaaff9e102e2a89173ca31479b80629 call \
run --source DIR_PATHfunc (m *MyModule) Example(source *dagger.Directory) *dagger.Container {
return dag.
GolangciLint().
Run(source)
}@function
def example(source: dagger.Directory) -> dagger.Container:
return (
dag.golangci_lint()
.run(source)
)@func()
example(source: Directory): Container {
return dag
.golangciLint()
.run(source)
}fmt() 🔗
Format Go source files.
Return Type
Directory !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| source | Directory ! | - | No description provided |
| config | File | - | Read custom configuration file. |
| rawArgs | [String ! ] | - | Additional arguments to pass to the command. |
Example
dagger -m github.com/sagikazarmark/daggerverse/golangci-lint@e6c14178bcaaff9e102e2a89173ca31479b80629 call \
fmt --source DIR_PATHfunc (m *MyModule) Example(source *dagger.Directory) *dagger.Directory {
return dag.
GolangciLint().
Fmt(source)
}@function
def example(source: dagger.Directory) -> dagger.Directory:
return (
dag.golangci_lint()
.fmt(source)
)@func()
example(source: Directory): Directory {
return dag
.golangciLint()
.fmt(source)
}