Skip to content

Commit 576f96b

Browse files
author
mehdihadeli
committed
some refactoring
1 parent ba17fcd commit 576f96b

File tree

4 files changed

+57
-2
lines changed

4 files changed

+57
-2
lines changed

.gitignore

+8
Original file line numberDiff line numberDiff line change
@@ -36,3 +36,11 @@ go.work
3636

3737
# Built Visual Studio Code Extensions
3838
*.vsix
39+
40+
*.exe
41+
*.test
42+
*.prof
43+
*.test
44+
*.out
45+
*.txt
46+
cover.html

examples/cqrs/cmd/main.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ func main() {
7676

7777
go func() {
7878
if err := echo.Start(":9080"); err != nil {
79-
log.Fatalf("Error starting Server: ", err)
79+
log.Fatal("Error starting Server", err)
8080
}
8181
}()
8282

golangci.yml

+47
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
linters:
2+
disable-all: true
3+
enable:
4+
- deadcode
5+
- errcheck
6+
- gosimple
7+
- govet
8+
- ineffassign
9+
- staticcheck
10+
- structcheck
11+
- typecheck
12+
- unused
13+
- varcheck
14+
- asciicheck
15+
- bodyclose
16+
- dogsled
17+
- exhaustive
18+
- exportloopref
19+
- gocognit
20+
- goconst
21+
- gofmt
22+
- goheader
23+
- goimports
24+
- gosec
25+
- misspell
26+
- nakedret
27+
- nestif
28+
- noctx
29+
- rowserrcheck
30+
- sqlclosecheck
31+
- unconvert
32+
- unparam
33+
- whitespace
34+
35+
issues:
36+
exclude:
37+
- "composite literal uses unkeyed fields"
38+
exclude-rules:
39+
- path: _test\.go
40+
linters:
41+
- gosec
42+
- noctx
43+
- unparam
44+
- bodyclose
45+
- path: fixtures.go
46+
linters:
47+
- gosec

mediatr.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ func RegisterNotificationHandler[TEvent any](handler NotificationHandler[TEvent]
6565
eventType := reflect.TypeOf(event)
6666

6767
handlers, exist := notificationHandlersRegistrations[eventType]
68-
if exist == false {
68+
if !exist {
6969
notificationHandlersRegistrations[eventType] = []interface{}{handler}
7070
return nil
7171
}

0 commit comments

Comments
 (0)