@@ -316,15 +316,15 @@ func (s *Server) addProductToOrder(w http.ResponseWriter, r *http.Request, ps ht
316316 ID : orderID ,
317317 }
318318 if err := s .db .Model (& order ).Select (); err != nil {
319- tx .Rollback ()
319+ _ = tx .Rollback ()
320320 http .Error (w , err .Error (), errToStatusCode (err ))
321321 return
322322 }
323323
324324 const productIDParam = "productID"
325325 productIDString := r .URL .Query ().Get (productIDParam )
326326 if productIDString == "" {
327- tx .Rollback ()
327+ _ = tx .Rollback ()
328328 writeMissingParamError (w , productIDParam )
329329 return
330330 }
@@ -337,14 +337,14 @@ func (s *Server) addProductToOrder(w http.ResponseWriter, r *http.Request, ps ht
337337 ID : productID ,
338338 }
339339 if err := s .db .Model (& addedProduct ).Select (); err != nil {
340- tx .Rollback ()
340+ _ = tx .Rollback ()
341341 http .Error (w , err .Error (), errToStatusCode (err ))
342342 return
343343 }
344344
345345 order .Products = append (order .Products , addedProduct )
346346 if _ , err := tx .Model (& order ).Insert (); err != nil {
347- tx .Rollback ()
347+ _ = tx .Rollback ()
348348 http .Error (w , err .Error (), errToStatusCode (err ))
349349 return
350350 }
@@ -353,7 +353,7 @@ func (s *Server) addProductToOrder(w http.ResponseWriter, r *http.Request, ps ht
353353 Product : addedProduct ,
354354 }
355355 if _ , err := tx .Model (& orderProduct ).Insert (); err != nil {
356- tx .Rollback ()
356+ _ = tx .Rollback ()
357357 http .Error (w , err .Error (), errToStatusCode (err ))
358358 return
359359 }
0 commit comments