Add linting (#23)
Adds linting and fixes a couple of linting issues. Closes #6.
This commit is contained in:
parent
14ea447010
commit
816ea3dd2b
3 changed files with 9 additions and 3 deletions
2
.github/workflows/ci.yaml
vendored
2
.github/workflows/ci.yaml
vendored
|
|
@ -22,3 +22,5 @@ jobs:
|
|||
VERSION: latest
|
||||
- name: Test
|
||||
run: make test
|
||||
- name: Lint
|
||||
run: make lint
|
||||
|
|
|
|||
4
Makefile
4
Makefile
|
|
@ -19,3 +19,7 @@ push:
|
|||
.PHONY: test
|
||||
test:
|
||||
go test -v .
|
||||
|
||||
.PHONY: lint
|
||||
lint:
|
||||
docker run --rm -v $$(pwd):/app -w /app golangci/golangci-lint:v1.46.2 golangci-lint run -v
|
||||
|
|
|
|||
6
main.go
6
main.go
|
|
@ -13,7 +13,7 @@ import (
|
|||
"golang.org/x/oauth2"
|
||||
)
|
||||
|
||||
func handleInterrupt(client *github.Client, ctx context.Context, apprv *approvalEnvironment) {
|
||||
func handleInterrupt(ctx context.Context, client *github.Client, apprv *approvalEnvironment) {
|
||||
newState := "closed"
|
||||
closeComment := "Workflow cancelled, closing issue."
|
||||
fmt.Println(closeComment)
|
||||
|
|
@ -158,8 +158,8 @@ func main() {
|
|||
select {
|
||||
case exitCode := <-commentLoopChannel:
|
||||
os.Exit(exitCode)
|
||||
case _ = <-killSignalChannel:
|
||||
handleInterrupt(client, ctx, apprv)
|
||||
case <-killSignalChannel:
|
||||
handleInterrupt(ctx, client, apprv)
|
||||
os.Exit(1)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue