mirror of
https://github.com/minio/mc.git
synced 2025-11-12 01:02:26 +03:00
support for "rm" of objects and buckets
This commit is contained in:
10
url.go
10
url.go
@@ -85,3 +85,13 @@ func url2Stat(urlStr string) (client client.Client, content *client.Content, err
|
||||
}
|
||||
return client, content, nil
|
||||
}
|
||||
|
||||
// just like filepath.Dir but always has a trailing url.Seperator
|
||||
func url2Dir(urlStr string) string {
|
||||
url := client.NewURL(urlStr)
|
||||
if strings.HasSuffix(urlStr, string(url.Separator)) {
|
||||
return urlStr
|
||||
}
|
||||
lastIndex := strings.LastIndex(urlStr, string(url.Separator))
|
||||
return urlStr[:lastIndex+1]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user