From 606c42cd5e241588ca1e5146d886a393b25ef51e Mon Sep 17 00:00:00 2001 From: ycc Date: Wed, 5 Jun 2024 21:07:00 +0200 Subject: [PATCH] add name to server when creating from uid or url --- client/server.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/client/server.go b/client/server.go index 152bb6f..d8a42d2 100644 --- a/client/server.go +++ b/client/server.go @@ -39,6 +39,7 @@ type Server struct { // CreateServerFromUrl creates a server from a basic url, ex : https://my.meowserver.example:8443/meow/ func CreateServerFromUrl(url string) *Server { var is Server + is.Name = url is.Url = url return &is } @@ -47,6 +48,7 @@ func CreateServerFromUrl(url string) *Server { func CreateServerFromUid(uid string) *Server { var is Server uidTable := strings.Split(uid, "@") //! Weak test, use regexp + is.Name = uid if len(uidTable) == 2 { loginpw := strings.Split(uidTable[0], ":") is.Url = uidTable[1]