]> Sergey Matveev's repositories - mmc.git/commitdiff
maps.Copy
authorSergey Matveev <stargrave@stargrave.org>
Sun, 13 Jul 2025 07:25:26 +0000 (10:25 +0300)
committerSergey Matveev <stargrave@stargrave.org>
Sun, 13 Jul 2025 07:25:26 +0000 (10:25 +0300)
cmd/mmc/main.go

index d367dc31357a404f01c01f314afe969b9eded80a..7e3ee59e2920e02dd752924de4c498dfda0f5edb 100644 (file)
@@ -27,6 +27,7 @@ import (
        "io"
        "io/fs"
        "log"
+       "maps"
        "net/http"
        "net/url"
        "os"
@@ -43,7 +44,7 @@ import (
        "github.com/gorilla/websocket"
        "github.com/mattermost/mattermost-server/v6/model"
        "go.cypherpunks.su/netrc/v2"
-       "go.stargrave.org/mmc/internal"
+       mmc "go.stargrave.org/mmc/internal"
 )
 
 var (
@@ -603,9 +604,7 @@ func main() {
                                        for u := range UserStatus {
                                                delete(UserStatus, u)
                                        }
-                                       for u, status := range statuses {
-                                               UserStatus[u] = status
-                                       }
+                                       maps.Copy(UserStatus, statuses)
                                        UserStatusM.Unlock()
                                }
                        }