Skip to content

Commit 9b13cd4

Browse files
authored
Merge pull request #99 from nimblehq/release/2.1.0
Release 2.1.0
2 parents b12eb88 + 256b454 commit 9b13cd4

31 files changed

+251
-260
lines changed

.github/CODEOWNERS

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Team
2+
# @carryall is the Team Lead and the others are team members
3+
* @carryall @hoangmirs @malparty @Nihisil @suphanatjarukulgowit
4+
5+
# Engineering Leads
6+
CODEOWNERS @nimblehq/engineering-leads

.github/ISSUE_TEMPLATE/bug_template.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@ labels: "type : bug"
88
## Issue
99

1010
Describe the issue you are facing. Show us the implementation: screenshots, gif, etc.
11-
11+
1212
## Expected
1313

1414
Describe what should be the correct behaviour.
15-
15+
1616
## Steps to reproduce
1717

18-
1.
19-
2.
20-
3.
18+
1.
19+
2.
20+
3.
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
name: "Chore"
3+
about: "Open a Chore for minor update."
4+
title: "Update "
5+
labels: "type : chore"
6+
---
7+
8+
## Why
9+
10+
Describe the update details and why it's needed.
11+
12+
## Who Benefits?
13+
14+
Describe who will be the beneficiaries e.g. everyone, specific chapters, clients...

.github/ISSUE_TEMPLATE/feature_template.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ labels: "type : feature"
77

88
## Why
99

10-
Describe the big picture of the feature and why it's needed.
11-
10+
Describe the big picture of the feature and why it's needed.
11+
1212
## Who Benefits?
1313

1414
Describe who will be the beneficiaries e.g. everyone, specific chapters, clients...

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
https://github.com/nimblehq/git-template/issues/??
1+
Resolve https://github.com/nimblehq/gin-templates/issues/??
22

33
## What happened 👀
44

5-
Describe the big picture of your changes here to communicate to the team why we should accept this pull request.
6-
5+
Provide a description of the **changes** this pull request brings to the codebase. Additionally, when the pull request is still being worked on, a checklist of the planned changes is welcome to track progress.
6+
77
## Insight 📝
88

9-
Describe in details how to test the changes, which solution you tried but did not go with, referenced documentation is welcome as well.
10-
9+
Describe in detail why this solution is the most appropriate, which solution you tried but did not go with, and how to test the changes. References to relevant documentation are welcome as well.
10+
1111
## Proof Of Work 📹
1212

13-
Show us the implementation: screenshots, gif, etc.
13+
Show us the implementation: screenshots, GIFs, etc.

.github/workflows/test.yml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,21 +6,26 @@ jobs:
66
test:
77
runs-on: ubuntu-latest
88
steps:
9+
- name: Cancel previous runs
10+
uses: styfle/cancel-workflow-action@0.9.1
11+
with:
12+
access_token: ${{ github.token }}
13+
914
- name: Checkout
1015
uses: actions/checkout@v2.3.4
1116

1217
- name: Install cookiecutter
1318
run: sudo -H python3 -m pip install cookiecutter
1419

1520
- name: Setup Go environment
16-
uses: actions/setup-go@v2.1.3
21+
uses: actions/setup-go@v3
1722
with:
18-
go-version: 1.16.x
23+
go-version: 1.20.x
1924

2025
- name: Linters
21-
uses: golangci/golangci-lint-action@v2
26+
uses: golangci/golangci-lint-action@v3
2227
with:
23-
version: v1.29
28+
version: v1.51
2429

2530
- name: Test
2631
env:

.tool-versions

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
golang 1.20

README.md

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
---
1010

11-
Our templates offer a rich boilerplate to jump start Go Gin-based application development.
11+
Our templates offer a rich boilerplate to jump start Go [Gin-based](https://github.com/gin-gonic/gin) application development.
1212

1313
Check this [wiki](https://github.com/nimblehq/gin-templates/wiki/Directories) for more information about the template structure.
1414

@@ -20,22 +20,25 @@ Check this [wiki](https://github.com/nimblehq/gin-templates/wiki/Directories) fo
2020
- Cookiecutter
2121
- Mac: `brew install cookiecutter`
2222
- Debian/Ubuntu: `sudo apt-get install cookiecutter`
23-
- Go version >= 1.16
23+
- Go version >= 1.20
2424

2525
## Usage
2626

2727
- Download **latest** version of gin-templates.
28-
```
28+
29+
```sh
2930
go get github.com/nimblehq/gin-templates
3031
```
3132

3233
- Build the binary file.
33-
```
34+
35+
```sh
3436
go build -o $GOPATH/bin/nimble-gin github.com/nimblehq/gin-templates
3537
```
3638

3739
- Create the project using gin-templates. Note that the **main** branch is being used by default. Refer to [this wiki page](https://github.com/nimblehq/gin-templates/wiki/Commands) for instructions on how to use a different branch.
38-
```
40+
41+
```sh
3942
nimble-gin create
4043
```
4144

@@ -54,7 +57,7 @@ make test
5457
This project is Copyright (c) 2014 and onwards Nimble. It is free software,
5558
and may be redistributed under the terms specified in the [LICENSE] file.
5659

57-
[LICENSE]: /LICENSE
60+
[license]: /LICENSE
5861

5962
## About
6063

cmd/create_test.go

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package cmd_test
22

33
import (
4-
"io/ioutil"
54
"os"
65

76
"github.com/nimblehq/gin-templates/tests"
@@ -125,13 +124,13 @@ var _ = Describe("Create template", func() {
125124
})
126125

127126
Context("given bootstrap/database.go", func() {
128-
It("contains project name at helpers import", func() {
127+
It("contains project name at database import", func() {
129128
cookiecutter := tests.Cookiecutter{AppName: "test-gin-templates"}
130129
cookiecutter.CreateProjectFromGinTemplate(currentTemplatePath)
131130

132131
content := tests.ReadFile("bootstrap/database.go")
133132

134-
expectedContent := `"github.com/nimblehq/test-gin-templates/helpers"`
133+
expectedContent := `"github.com/nimblehq/test-gin-templates/database"`
135134

136135
Expect(content).To(ContainSubstring(expectedContent))
137136
})
@@ -296,7 +295,7 @@ var _ = Describe("Create template", func() {
296295
cookiecutter.CreateProjectFromGinTemplate(currentTemplatePath)
297296
content := tests.ReadFile("go.mod")
298297

299-
expectedContent := "github.com/sirupsen/logrus v1.8.1"
298+
expectedContent := "github.com/sirupsen/logrus"
300299

301300
Expect(content).To(ContainSubstring(expectedContent))
302301
})
@@ -314,13 +313,26 @@ var _ = Describe("Create template", func() {
314313
Expect(content).To(ContainSubstring(expectedContent))
315314
})
316315

317-
It("contains logrus package import in bootstrap/database.go", func() {
316+
Context("given database/database.go", func() {
317+
It("contains project name at helpers import", func() {
318+
cookiecutter := tests.Cookiecutter{AppName: "test-gin-templates"}
319+
cookiecutter.CreateProjectFromGinTemplate(currentTemplatePath)
320+
321+
content := tests.ReadFile("database/database.go")
322+
323+
expectedContent := `"github.com/nimblehq/test-gin-templates/helpers"`
324+
325+
Expect(content).To(ContainSubstring(expectedContent))
326+
})
327+
})
328+
329+
It("contains logrus package import in database/database.go", func() {
318330
cookiecutter := tests.Cookiecutter{
319331
AppName: "test-gin-templates",
320332
UseLogrus: tests.Yes,
321333
}
322334
cookiecutter.CreateProjectFromGinTemplate(currentTemplatePath)
323-
content := tests.ReadFile("bootstrap/database.go")
335+
content := tests.ReadFile("database/database.go")
324336

325337
expectedContent := "github.com/nimblehq/test-gin-templates/helpers/log"
326338

@@ -450,7 +462,7 @@ var _ = Describe("Create template", func() {
450462
UseHeroku: tests.Yes,
451463
}
452464
cookiecutter.CreateProjectFromGinTemplate(currentTemplatePath)
453-
files, err := ioutil.ReadDir("deploy/heroku")
465+
files, err := os.ReadDir("deploy/heroku")
454466
if err != nil {
455467
Fail("Failed to read directory: " + err.Error())
456468
}

go.mod

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,21 @@
11
module github.com/nimblehq/gin-templates
22

3-
go 1.16
3+
go 1.20
44

55
require (
66
github.com/onsi/ginkgo v1.15.0
77
github.com/onsi/gomega v1.10.5
88
github.com/spf13/cobra v1.1.1
99
)
10+
11+
require (
12+
github.com/fsnotify/fsnotify v1.4.9 // indirect
13+
github.com/inconshreveable/mousetrap v1.0.0 // indirect
14+
github.com/nxadm/tail v1.4.4 // indirect
15+
github.com/spf13/pflag v1.0.5 // indirect
16+
golang.org/x/net v0.0.0-20201202161906-c7110b5ffcbb // indirect
17+
golang.org/x/sys v0.0.0-20210112080510-489259a85091 // indirect
18+
golang.org/x/text v0.3.3 // indirect
19+
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 // indirect
20+
gopkg.in/yaml.v2 v2.3.0 // indirect
21+
)

0 commit comments

Comments
 (0)