Skip to content

Commit a79bffb

Browse files
committed
Fix Homebrew warning; Fix go-critic issues
1 parent f14c516 commit a79bffb

File tree

7 files changed

+15
-16
lines changed

7 files changed

+15
-16
lines changed

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@ clean:
44
rm -rf ./tmp coverage.out
55

66
lint:
7-
golangci-lint run
7+
golangci-lint run ./...
88

99
security:
1010
gosec -quiet ./...
1111

1212
critic:
13-
gocritic check ./...
13+
gocritic check -enableAll ./...
1414

1515
test: clean lint security critic
1616
go test -coverprofile=coverage.out ./...

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
</h1>
55
<p align="center">Create a new production-ready project with <b>backend</b> (Golang), <b>frontend</b> (JavaScript, TypeScript)<br/>and <b>deploy automation</b> (Ansible, Docker) by running one CLI command.<br/><br/>Focus on <b>writing</b> code and <b>thinking</b> of business-logic! The CLI will take care of the rest.</p>
66

7-
<p align="center"><a href="https://github.com/create-go-app/cli/releases" target="_blank"><img src="https://img.shields.io/badge/version-v3.2.0-blue?style=for-the-badge&logo=none" alt="cli version" /></a>&nbsp;<a href="https://pkg.go.dev/github.com/create-go-app/cli/v3?tab=doc" target="_blank"><img src="https://img.shields.io/badge/Go-1.17+-00ADD8?style=for-the-badge&logo=go" alt="go version" /></a>&nbsp;<a href="https://gocover.io/github.com/create-go-app/cli/pkg/cgapp" target="_blank"><img src="https://img.shields.io/badge/Go_Cover-89.2%25-success?style=for-the-badge&logo=none" alt="go cover" /></a>&nbsp;<a href="https://goreportcard.com/report/github.com/create-go-app/cli" target="_blank"><img src="https://img.shields.io/badge/Go_report-A+-success?style=for-the-badge&logo=none" alt="go report" /></a>&nbsp;<img src="https://img.shields.io/badge/license-apache_2.0-red?style=for-the-badge&logo=none" alt="license" /></p>
7+
<p align="center"><a href="https://github.com/create-go-app/cli/releases" target="_blank"><img src="https://img.shields.io/badge/version-v3.2.1-blue?style=for-the-badge&logo=none" alt="cli version" /></a>&nbsp;<a href="https://pkg.go.dev/github.com/create-go-app/cli/v3?tab=doc" target="_blank"><img src="https://img.shields.io/badge/Go-1.17+-00ADD8?style=for-the-badge&logo=go" alt="go version" /></a>&nbsp;<a href="https://gocover.io/github.com/create-go-app/cli/pkg/cgapp" target="_blank"><img src="https://img.shields.io/badge/Go_Cover-89.2%25-success?style=for-the-badge&logo=none" alt="go cover" /></a>&nbsp;<a href="https://goreportcard.com/report/github.com/create-go-app/cli" target="_blank"><img src="https://img.shields.io/badge/Go_report-A+-success?style=for-the-badge&logo=none" alt="go report" /></a>&nbsp;<img src="https://img.shields.io/badge/license-apache_2.0-red?style=for-the-badge&logo=none" alt="license" /></p>
88

99
## ⚡️ Quick start
1010

go.mod

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ require (
2828
github.com/spf13/pflag v1.0.5 // indirect
2929
github.com/xanzy/ssh-agent v0.3.1 // indirect
3030
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519 // indirect
31-
golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f // indirect
32-
golang.org/x/sys v0.0.0-20211015200801-69063c4bb744 // indirect
31+
golang.org/x/net v0.0.0-20211020060615-d418f374d309 // indirect
32+
golang.org/x/sys v0.0.0-20211020174200-9d6173849985 // indirect
3333
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 // indirect
3434
golang.org/x/text v0.3.7 // indirect
3535
gopkg.in/warnings.v0 v0.1.2 // indirect

go.sum

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -402,8 +402,8 @@ golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v
402402
golang.org/x/net v0.0.0-20210316092652-d523dce5a7f4/go.mod h1:RBQZq4jEuRlivfhVLdyRGr576XBO4/greRjx4P4O3yc=
403403
golang.org/x/net v0.0.0-20210326060303-6b1517762897/go.mod h1:uSPa2vr4CLtc/ILN5odXGNXS6mhrKVzTaCXzk9m6W3k=
404404
golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM=
405-
golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f h1:OfiFi4JbukWwe3lzw+xunroH1mnC1e2Gy5cxNJApiSY=
406-
golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
405+
golang.org/x/net v0.0.0-20211020060615-d418f374d309 h1:A0lJIi+hcTR6aajJH4YqKWwohY4aW9RO7oRMcdv+HKI=
406+
golang.org/x/net v0.0.0-20211020060615-d418f374d309/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
407407
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
408408
golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
409409
golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
@@ -479,8 +479,8 @@ golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBc
479479
golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
480480
golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
481481
golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
482-
golang.org/x/sys v0.0.0-20211015200801-69063c4bb744 h1:KzbpndAYEM+4oHRp9JmB2ewj0NHHxO3Z0g7Gus2O1kk=
483-
golang.org/x/sys v0.0.0-20211015200801-69063c4bb744/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
482+
golang.org/x/sys v0.0.0-20211020174200-9d6173849985 h1:LOlKVhfDyahgmqa97awczplwkjzNaELFg3zRIJ13RYo=
483+
golang.org/x/sys v0.0.0-20211020174200-9d6173849985/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
484484
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
485485
golang.org/x/term v0.0.0-20210503060354-a79de5458b56/go.mod h1:tfny5GFUkzUvx4ps4ajbZsCe5lw1metzhBm9T3x7oIY=
486486
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 h1:JGgROgKl9N8DuW20oFS5gxc+lE67/N3FcwmBPMe7ArY=

pkg/cgapp/files.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import (
88
"embed"
99
"fmt"
1010
"io/fs"
11-
"io/ioutil"
1211
"os"
1312
"path/filepath"
1413
"strings"
@@ -100,7 +99,7 @@ func GenerateFileFromTemplate(fileName string, variables map[string]interface{})
10099
// MakeFile function for single file create.
101100
func MakeFile(fileName string, fileData []byte) error {
102101
// Write to created file.
103-
if err := ioutil.WriteFile(fileName, fileData, 0600); err != nil {
102+
if err := os.WriteFile(fileName, fileData, 0o600); err != nil {
104103
return err
105104
}
106105

@@ -110,7 +109,7 @@ func MakeFile(fileName string, fileData []byte) error {
110109
// MakeFolder function for create folder.
111110
func MakeFolder(folderName string) error {
112111
// Check if folder exists, fail if it does.
113-
if err := os.Mkdir(folderName, 0750); err != nil {
112+
if err := os.Mkdir(folderName, 0o750); err != nil {
114113
return err
115114
}
116115

pkg/cgapp/files_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ func TestMakeFolder(t *testing.T) {
8989
},
9090
}
9191

92-
_ = os.Mkdir("cgapp-project", 0750)
92+
_ = os.Mkdir("cgapp-project", 0o750)
9393

9494
for _, tt := range tests {
9595
t.Run(tt.name, func(t *testing.T) {
@@ -121,7 +121,7 @@ func TestRemoveFolders(t *testing.T) {
121121
},
122122
}
123123

124-
_ = os.MkdirAll("../../tmp/folder-1", 0750)
124+
_ = os.MkdirAll("../../tmp/folder-1", 0o750)
125125

126126
for _, tt := range tests {
127127
t.Run(tt.name, func(t *testing.T) {
@@ -219,7 +219,7 @@ func TestGenerateFileFromTemplate(t *testing.T) {
219219
},
220220
}
221221

222-
_ = os.Mkdir("../../tmp", 0750)
222+
_ = os.Mkdir("../../tmp", 0o750)
223223
_, _ = os.Create("../../tmp/test.txt")
224224

225225
for _, tt := range tests {

pkg/registry/defaults.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import (
1111
)
1212

1313
// CLIVersion version of Create Go App CLI.
14-
const CLIVersion string = "3.2.0"
14+
const CLIVersion string = "3.2.1"
1515

1616
// Variables struct for Ansible variables (inventory, hosts).
1717
type Variables struct {

0 commit comments

Comments
 (0)