Skip to content

Commit 7ce0ba6

Browse files
author
Vic Shóstak
committed
Switch from Taskfile.yml to Makefile
1 parent 0e58b67 commit 7ce0ba6

File tree

6 files changed

+25
-49
lines changed

6 files changed

+25
-49
lines changed

.dockerignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
Dockerfile
66
Makefile
77
LICENSE
8-
Taskfile.yml
98
*.md
109

1110
# Folders

Makefile

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
.PHONY: clean test security build run
2+
3+
BUILD_DIR = $(PWD)/build
4+
APP_NAME = apiserver
5+
6+
clean:
7+
rm -rf ./build
8+
9+
test:
10+
go test -cover ./...
11+
12+
security:
13+
gosec -quiet ./...
14+
15+
build: security test
16+
CGO_ENABLED=0 go build -ldflags="-w -s" -o $(BUILD_DIR)/$(APP_NAME) main.go
17+
18+
run: clean build
19+
$(BUILD_DIR)/$(APP_NAME)

README.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,9 @@ cgapp create
1717
2. Run project by this command:
1818

1919
```bash
20-
task -s
20+
make run
2121
```
2222

23-
> ☝️ We're using `Taskfile` as task manager for running project on a local machine by default. If you've never heard of `Taskfile`, we recommend to read the [Docs](https://taskfile.dev/#/usage?id=getting-started) and use it, instead of `Makefile`.
24-
2523
## ✅ Used packages
2624

2725
- [gorilla/mux](https://github.com/gorilla/mux) `v1.7.4`
@@ -35,7 +33,7 @@ task -s
3533
├── .editorconfig
3634
├── .gitignore
3735
├── Dockerfile
38-
├── Taskfile.yml
36+
├── Makefile
3937
├── go.mod
4038
├── go.sum
4139
├── main.go

Taskfile.yml

Lines changed: 0 additions & 39 deletions
This file was deleted.

go.sum

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
1-
github.com/gorilla/mux v1.7.4 h1:VuZ8uybHlWmqV03+zRzdwKL4tUnIp1MAQtp1mIFE1bc=
2-
github.com/gorilla/mux v1.7.4/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So=
31
github.com/gorilla/mux v1.8.0 h1:i40aqfkR1h2SlN9hojwV5ZA91wcXFOvkdNIeFDP5koI=
42
github.com/gorilla/mux v1.8.0/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So=
53
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
64
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
7-
gopkg.in/yaml.v2 v2.3.0 h1:clyUAQHOM3G0M3f5vQj7LuJrETvjVot3Z5el9nffUtU=
8-
gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
5+
gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=
96
gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=

pkg/apiserver/new_server.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,9 @@ func (s *APIServer) Start() {
7878

7979
// Doesn't block if no connections, but will otherwise wait
8080
// until the timeout deadline.
81-
server.Shutdown(ctx)
81+
if err := server.Shutdown(ctx); err != nil {
82+
log.Println(err)
83+
}
8284

8385
// Optionally, you could run srv.Shutdown in a goroutine and block on
8486
// <-ctx.Done() if your application should wait for other services

0 commit comments

Comments
 (0)