simplified prefix removal, removed unnecessary if-else statements

This commit is contained in:
Alexandr Bruyako
2019-06-30 23:34:47 +03:00
parent 16eeed2ad5
commit 02014be76c
4 changed files with 4 additions and 16 deletions

View File

@@ -47,9 +47,7 @@ func ParseConfig(s string) (interface{}, error) {
return nil, errors.New("azure: invalid format: bucket name or path not found")
}
container, path := data[0], path.Clean(data[1])
if strings.HasPrefix(path, "/") {
path = path[1:]
}
path = strings.TrimPrefix(path, "/")
cfg := NewConfig()
cfg.Container = container
cfg.Prefix = path