working commit

This commit is contained in:
2026-02-23 00:07:38 +02:00
parent 685880c8a8
commit b6efc19f7a
41 changed files with 11938 additions and 93 deletions
+19
View File
@@ -58,3 +58,22 @@ func repackReference(ref string) (string, string, string, error) {
ref = uri.Host + uri.Path
return ref, username, password, err
}
func repackSource(ref string) (string, string, string, error) {
var err error
var username string
var password string
if !strings.Contains(ref, `://`) {
ref = "https://" + ref
}
uri, err := url.Parse(ref)
if err != nil {
return ref, username, password, err
}
username = uri.User.Username()
password, _ = uri.User.Password()
uri.User = nil
ref = uri.Host
return ref, username, password, err
}