8000 s3 compatibility: add missing XML tags (for consistency) · NVIDIA/aistore@91c86b6 · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Commit 91c86b6

Browse files
committed
s3 compatibility: add missing XML tags (for consistency)
Signed-off-by: Alex Aizman <alex.aizman@gmail.com>
1 parent 3b6fc50 commit 91c86b6

File tree

3 files changed

+14
-5
lines changed

3 files changed

+14
-5
lines changed

.golangci.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ linter 8000 s:
2828
- importas
2929
- ineffassign
3030
- intrange
31+
- musttag
3132
- misspell
3233
- nakedret
3334
- nilnesserr

ais/s3/err.go

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,18 @@ import (
2020

2121
const ErrPrefix = "aws-error"
2222

23+
// See https://docs.aws.amazon.com/AmazonS3/latest/API/ErrorResponses.html
24+
// e.g. XML:
25+
// <Error>
26+
// <Code>NoSuchKey</Code>
27+
// <Message>The resource you requested does not exist</Message>
28+
// <Resource>/mybucket/myfoto.jpg</Resource>
29+
// <RequestId>4442587FB7D0A2F9</RequestId>
30+
// </Error>
2331
type Error struct {
24-
Code string
25-
Message string
26-
Resource string
32+
Code string `xml:"Code"`
33+
Message string `xml:"Message"`
34+
Resource string `xml:"Resource"`
2735
RequestID string `xml:"RequestId"`
2836
}
2937

ais/s3/types.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,8 @@ type (
9696
Bucket string `xml:"Bucket"`
9797
UploadIDMarker string `xml:"UploadIdMarker"`
9898
Uploads []UploadInfoResult `xml:"Upload"`
99-
MaxUploads int
100-
IsTruncated bool
99+
MaxUploads int `xml:"MaxUploads"`
100+
IsTruncated bool `xml:"IsTruncated"`
101101
}
102102

103103
// Deleted result: list of deleted objects and errors

0 commit comments

Comments
 (0)
0