diff --git a/.golangci.yml b/.golangci.yml new file mode 100644 index 00000000..bb593d8f --- /dev/null +++ b/.golangci.yml @@ -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 diff --git a/Taskfile.yml b/Taskfile.yml index 9145fe57..4d9740ea 100644 --- a/Taskfile.yml +++ b/Taskfile.yml @@ -47,6 +47,7 @@ tasks: aliases: [l] sources: - './**/*.go' + - .golangci.yml cmds: - golangci-lint run diff --git a/cmd/sleepit/sleepit.go b/cmd/sleepit/sleepit.go index 90201d1c..940d362a 100644 --- a/cmd/sleepit/sleepit.go +++ b/cmd/sleepit/sleepit.go @@ -130,11 +130,11 @@ func supervisor( // The goroutine will prepend its prints with the prefix `name`. // The goroutine will simulate some work and will terminate when one of the following // conditions happens: -// 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, -// 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 -// close the 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, +// 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 +// close the channel. func worker( canceled <-chan struct{}, howlong time.Duration,