golangci-lint
Fast linters runner for Go.
Installation
dagger install github.com/sagikazarmark/daggerverse/golangci-lint@v0.8.0
Entrypoint
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. |
container | Container | - | Custom container to use 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. |
goContainer | Container | - | Custom container to use as a Go base container. |
disableGoCache | Boolean | - | Disable mounting default Go cache volumes. |
Example
dagger -m github.com/sagikazarmark/daggerverse/golangci-lint@c1d94aa5430d5bb7bc1cee0be85ac15919087303 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@c1d94aa5430d5bb7bc1cee0be85ac15919087303 call \
binary
func (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@c1d94aa5430d5bb7bc1cee0be85ac15919087303 call \
container
func (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@c1d94aa5430d5bb7bc1cee0be85ac15919087303 call \
with-cache --cache VOLUME_NAME
func (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@c1d94aa5430d5bb7bc1cee0be85ac15919087303 call \
run --source DIR_PATH
func (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@c1d94aa5430d5bb7bc1cee0be85ac15919087303 call \
fmt --source DIR_PATH
func (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)
}