@@ -51,7 +51,10 @@ func (mds *mockDataUploadServer) ServeHTTP(w http.ResponseWriter, r *http.Reques
51
51
func (mds * mockDataUploadServer ) handlePresignedUpload (w http.ResponseWriter , r * http.Request ) {
52
52
if r .Method != http .MethodPost {
53
53
w .WriteHeader (http .StatusMethodNotAllowed )
54
- _ , _ = w .Write ([]byte (`{"message":"method not allowed"}` ))
54
+ _ , err := w .Write ([]byte (`{"message":"method not allowed"}` ))
55
+ if err != nil {
56
+ panic (err )
57
+ }
55
58
return
56
59
}
57
60
@@ -95,7 +98,10 @@ func (mds *mockDataUploadServer) handlePresignedUpload(w http.ResponseWriter, r
95
98
if req .ClusterID == "invalid-json-retrieve-presigned" {
96
99
w .WriteHeader (http .StatusOK )
97
100
w .Header ().Set ("Content-Type" , "application/json" )
98
- _ , _ = w .Write ([]byte (`{"url":` )) // invalid JSON
101
+ _ , err := w .Write ([]byte (`{"url":` )) // invalid JSON
102
+ if err != nil {
103
+ panic (err )
104
+ }
99
105
return
100
106
}
101
107
@@ -122,7 +128,10 @@ func (mds *mockDataUploadServer) handlePresignedUpload(w http.ResponseWriter, r
122
128
func (mds * mockDataUploadServer ) handleUpload (w http.ResponseWriter , r * http.Request ) {
123
129
if r .Method != http .MethodPut {
124
130
w .WriteHeader (http .StatusMethodNotAllowed )
125
- _ , _ = w .Write ([]byte (`{"message":"method not allowed"}` ))
131
+ _ , err := w .Write ([]byte (`{"message":"method not allowed"}` ))
132
+ if err != nil {
133
+ panic (err )
134
+ }
126
135
return
127
136
}
128
137
@@ -132,7 +141,10 @@ func (mds *mockDataUploadServer) handleUpload(w http.ResponseWriter, r *http.Req
132
141
}
133
142
134
143
checksum := sha256 .New ()
135
- _ , _ = io .Copy (checksum , r .Body )
144
+ _ , err := io .Copy (checksum , r .Body )
145
+ if err != nil {
146
+ panic (err )
147
+ }
136
148
137
149
if r .URL .Query ().Get ("checksum" ) != hex .EncodeToString (checksum .Sum (nil )) {
138
150
http .Error (w , "checksum is invalid" , http .StatusInternalServerError )
0 commit comments