Skip to content

Commit 02f339f

Browse files
committed
Remove named return values
1 parent c758ce8 commit 02f339f

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

pkg/spaces/utils.go

+5-6
Original file line numberDiff line numberDiff line change
@@ -32,19 +32,18 @@ func DecodeSpaceID(raw string) (storageID, path string, ok bool) {
3232
// The input is expected to be in the form of <storage_id>$<base32(<path>)
3333
s := strings.SplitN(raw, "$", 2)
3434
if len(s) != 2 {
35-
return
35+
return "", "", false
3636
}
3737

3838
storageID = s[0]
3939
encodedPath := s[1]
4040
p, err := base32.StdEncoding.DecodeString(encodedPath)
4141
if err != nil {
42-
return
42+
return "", "", false
4343
}
4444

4545
path = string(p)
46-
ok = true
47-
return
46+
return storageID, path, true
4847
}
4948

5049
// Decode resourceID returns the components of the space ID.
@@ -53,11 +52,11 @@ func DecodeResourceID(raw string) (storageID, path, itemID string, ok bool) {
5352
// The input is expected to be in the form of <storage_id>$base32(<path>)!<item_id>
5453
s := strings.SplitN(raw, "!", 2)
5554
if len(s) != 2 {
56-
return
55+
return "", "", "", false
5756
}
5857
itemID = s[1]
5958
storageID, path, ok = DecodeSpaceID(s[0])
60-
return
59+
return storageID, path, itemID, ok
6160
}
6261

6362
// ParseResourceID converts the encoded resource id in a CS3API ResourceId.

0 commit comments

Comments
 (0)