This is an automated email from the ASF dual-hosted git repository.

ocket8888 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficcontrol.git


The following commit(s) were added to refs/heads/master by this push:
     new 13cdcaa  Fix remaining `go vet` issues with string(int) (#5084)
13cdcaa is described below

commit 13cdcaa4113e9b75d69b274fa48f52b335210f94
Author: Steve Hamrick <[email protected]>
AuthorDate: Wed Sep 30 17:17:09 2020 -0600

    Fix remaining `go vet` issues with string(int) (#5084)
    
    * Fix vet issues
    
    * Code review changes
---
 traffic_ops/traffic_ops_golang/deliveryservice/request/requests.go | 4 ++--
 traffic_ops/traffic_ops_golang/federations/ds.go                   | 3 +--
 2 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/traffic_ops/traffic_ops_golang/deliveryservice/request/requests.go 
b/traffic_ops/traffic_ops_golang/deliveryservice/request/requests.go
index 35c26b6..b06892b 100644
--- a/traffic_ops/traffic_ops_golang/deliveryservice/request/requests.go
+++ b/traffic_ops/traffic_ops_golang/deliveryservice/request/requests.go
@@ -22,7 +22,6 @@ package request
 import (
        "errors"
        "fmt"
-       
"github.com/apache/trafficcontrol/traffic_ops/traffic_ops_golang/util/ims"
        "net/http"
        "strconv"
        "time"
@@ -34,6 +33,7 @@ import (
        "github.com/apache/trafficcontrol/traffic_ops/traffic_ops_golang/auth"
        
"github.com/apache/trafficcontrol/traffic_ops/traffic_ops_golang/dbhelpers"
        "github.com/apache/trafficcontrol/traffic_ops/traffic_ops_golang/tenant"
+       
"github.com/apache/trafficcontrol/traffic_ops/traffic_ops_golang/util/ims"
 
        "github.com/jmoiron/sqlx"
 )
@@ -274,7 +274,7 @@ func (req *TODeliveryServiceRequest) Delete() (error, 
error, int) {
                return errors.New("missing id"), nil, http.StatusBadRequest
        }
 
-       st := tc.RequestStatus(0)
+       st := tc.RequestStatusInvalid
        if err := req.APIInfo().Tx.Tx.QueryRow(`SELECT status FROM 
deliveryservice_request WHERE id=$1`, *req.ID).Scan(&st); err != nil {
                return nil, errors.New("dsr delete querying status: " + 
err.Error()), http.StatusBadRequest
        }
diff --git a/traffic_ops/traffic_ops_golang/federations/ds.go 
b/traffic_ops/traffic_ops_golang/federations/ds.go
index a019066..d78953f 100644
--- a/traffic_ops/traffic_ops_golang/federations/ds.go
+++ b/traffic_ops/traffic_ops_golang/federations/ds.go
@@ -28,7 +28,6 @@ import (
        "time"
 
        "github.com/apache/trafficcontrol/lib/go-tc"
-
        "github.com/apache/trafficcontrol/traffic_ops/traffic_ops_golang/api"
        
"github.com/apache/trafficcontrol/traffic_ops/traffic_ops_golang/dbhelpers"
 
@@ -46,7 +45,7 @@ func PostDSes(w http.ResponseWriter, r *http.Request) {
        fedID := inf.IntParams["id"]
        fedName, ok, err := getFedNameByID(inf.Tx.Tx, fedID)
        if err != nil {
-               api.HandleErr(w, r, inf.Tx.Tx, http.StatusInternalServerError, 
nil, errors.New("getting federation cname from ID '"+string(fedID)+"': 
"+err.Error()))
+               api.HandleErr(w, r, inf.Tx.Tx, http.StatusInternalServerError, 
nil, fmt.Errorf("getting federation cname from ID '%v': %v", fedID, err))
                return
        } else if !ok {
                api.HandleErr(w, r, inf.Tx.Tx, http.StatusNotFound, 
fmt.Errorf("federation %v not found", fedID), nil)

Reply via email to