]> Sergey Matveev's repositories - mmc.git/commitdiff
Several linting fixes
authorSergey Matveev <stargrave@stargrave.org>
Fri, 30 Jun 2023 09:33:14 +0000 (12:33 +0300)
committerSergey Matveev <stargrave@stargrave.org>
Fri, 30 Jun 2023 09:33:14 +0000 (12:33 +0300)
cmd/mmc/main.go
netrc.go

index f27ec75504f6ec9ed05cce84bf38a2b49920b48e..b38738db555e5799dda0720e5c95f2f7bd354fea 100644 (file)
@@ -49,7 +49,7 @@ var (
 
 func rewriteIfChanged(fn string, data string) {
        if their, err := os.ReadFile(fn); err != nil ||
-               bytes.Compare([]byte(data), their) != 0 {
+               !bytes.Equal([]byte(data), their) {
                if err = os.WriteFile(fn, []byte(data), 0o666); err != nil {
                        log.Fatalln(err)
                }
@@ -508,7 +508,7 @@ func main() {
                                                userId = strings.TrimSuffix(userId, "__"+me.Id)
                                                user := Users[userId]
                                                if user == nil {
-                                                       log.Println("unknown user:", post)
+                                                       log.Println("unknown user:", userId)
                                                        continue
                                                }
                                                recipient = path.Join("users", user.Username)
index c3a9e61ab3a1cf73c7eccefe7e2fb2d131244764..18fa7b18a6959dbf5c21136f449c1c1ac200b943 100644 (file)
--- a/netrc.go
+++ b/netrc.go
@@ -61,7 +61,6 @@ func FindInNetrc(host string) (string, string) {
                                login = ""
                                password = ""
                        case "default":
-                               break
                        case "login":
                                login = fields[i+1]
                        case "password":