mirror of
https://github.com/go-task/task.git
synced 2025-08-10 22:42:19 +02:00
Add goimports as a linter
This commit is contained in:
8
.golangci.yml
Normal file
8
.golangci.yml
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
# NOTE(@andreynering): The linters listed here are additions on top of
|
||||||
|
# those enabled by default:
|
||||||
|
#
|
||||||
|
# https://golangci-lint.run/usage/linters/#enabled-by-default
|
||||||
|
|
||||||
|
linters:
|
||||||
|
enable:
|
||||||
|
- goimports
|
@@ -47,6 +47,7 @@ tasks:
|
|||||||
aliases: [l]
|
aliases: [l]
|
||||||
sources:
|
sources:
|
||||||
- './**/*.go'
|
- './**/*.go'
|
||||||
|
- .golangci.yml
|
||||||
cmds:
|
cmds:
|
||||||
- golangci-lint run
|
- golangci-lint run
|
||||||
|
|
||||||
|
@@ -130,11 +130,11 @@ func supervisor(
|
|||||||
// The goroutine will prepend its prints with the prefix `name`.
|
// The goroutine will prepend its prints with the prefix `name`.
|
||||||
// The goroutine will simulate some work and will terminate when one of the following
|
// The goroutine will simulate some work and will terminate when one of the following
|
||||||
// conditions happens:
|
// conditions happens:
|
||||||
// 1. When `howlong` is elapsed. This case will be signaled on the `workerDone` channel.
|
// 1. When `howlong` is elapsed. This case will be signaled on the `workerDone` channel.
|
||||||
// 2. When something happens on channel `canceled`. Note that this simulates real-life,
|
// 2. When something happens on channel `canceled`. Note that this simulates real-life,
|
||||||
// so cancellation is not instantaneous: if the caller wants a synchronous cancel,
|
// so cancellation is not instantaneous: if the caller wants a synchronous cancel,
|
||||||
// it should send a message; if instead it wants an asynchronous cancel, it should
|
// it should send a message; if instead it wants an asynchronous cancel, it should
|
||||||
// close the channel.
|
// close the channel.
|
||||||
func worker(
|
func worker(
|
||||||
canceled <-chan struct{},
|
canceled <-chan struct{},
|
||||||
howlong time.Duration,
|
howlong time.Duration,
|
||||||
|
Reference in New Issue
Block a user