Skip to content

Commit

Permalink
bugfix: only include path in file/files resource ID when non-empty
Browse files Browse the repository at this point in the history
  • Loading branch information
manicminer committed Mar 26, 2024
1 parent a86d2a3 commit dfcf14b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion storage/2023-11-03/file/files/resource_id.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,11 @@ func NewFileID(accountId accounts.AccountId, shareName, directoryPath, fileName
}

func (b FileId) ID() string {
return fmt.Sprintf("%s/%s/%s/%s", b.AccountId.ID(), b.ShareName, b.DirectoryPath, b.FileName)
path := ""
if b.DirectoryPath != "" {
path = fmt.Sprintf("%s/", b.DirectoryPath)
}
return fmt.Sprintf("%s/%s/%s%s", b.AccountId.ID(), b.ShareName, path, b.FileName)
}

func (b FileId) String() string {
Expand Down

0 comments on commit dfcf14b

Please sign in to comment.