Skip to content

Commit 3e97384

Browse files
committed
Enable some useful linters, and correct a couple linting errors.
1 parent 558c688 commit 3e97384

3 files changed

Lines changed: 7 additions & 3 deletions

File tree

.golangci.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,17 @@
88
"asciicheck",
99
"bidichk",
1010
"contextcheck",
11+
"decorder",
1112
"depguard",
1213
"dogsled",
1314
"dupl",
15+
"dupword",
1416
"errcheck",
1517
"errname",
1618
"errorlint",
1719
"exportloopref",
1820
"forcetypeassert",
21+
"gocheckcompilerdirectives",
1922
"goconst",
2023
"gocyclo",
2124
"godot",
@@ -37,6 +40,7 @@
3740
"unparam",
3841
"unused",
3942
"vetshadow",
43+
"wastedassign",
4044
"whitespace",
4145
]
4246

server/commands.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@ func init() {
4444
return
4545
}
4646
}
47-
password := ""
48-
locked := false
47+
var password string
48+
var locked bool
4949
db.Channel, password, locked = getChannelParams(db.Channel)
5050
if db.Channel == "" {
5151
enc, encerr := Encode(Data{

server/file.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ func fullPath(old_path string) string {
5555
return cleanPath(e_path)
5656
}
5757
e_path = ""
58-
n_path := ""
58+
var n_path string
5959
err = nil
6060
for _, v := range strings.Split(path, PS) {
6161
e_path += v + PS

0 commit comments

Comments
 (0)