Skip to content

Commit

Permalink
%s -> %v for printing errors
Browse files Browse the repository at this point in the history
  • Loading branch information
synackd committed Aug 5, 2024
1 parent 3d19869 commit adf2998
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions cmd/boot-script-service/serviceAPI.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,14 +108,14 @@ func serviceStatusAPI(w http.ResponseWriter, req *http.Request) {
if err != nil {
httpStatus = http.StatusInternalServerError
sb.Status = "error"
log.Printf("Test store to etcd failed: %s", err)
log.Printf("Test store to etcd failed: %v", err)
} else {
ret, err := etcdTestGet()
if err != nil || ret != randnum {
httpStatus = http.StatusInternalServerError
sb.Status = "error"
if err != nil {
log.Printf("Test read from etcd failed: %s", err)
log.Printf("Test read from etcd failed: %v", err)
} else {
log.Printf("Test read from etcd miscompare: Expected %d, Actual %d", randnum, ret)
}
Expand Down Expand Up @@ -149,7 +149,7 @@ func serviceVersionResponse(w http.ResponseWriter, req *http.Request) {
if err != nil {
httpStatus = http.StatusInternalServerError
dat = []byte("error")
log.Printf("Cannot read version file: %s", err)
log.Printf("Cannot read version file: %v", err)
}
}
bssStatus.Version = strings.TrimSpace(string(dat))
Expand All @@ -169,7 +169,7 @@ func serviceHSMResponse(w http.ResponseWriter, req *http.Request) {
if err != nil {
httpStatus = http.StatusInternalServerError
bssStatus.HSMStatus = "error"
log.Printf("Cannot connect to HSM: %s", err)
log.Printf("Cannot connect to HSM: %v", err)
} else {
_, err = ioutil.ReadAll(rsp.Body)
if err != nil {
Expand Down

0 comments on commit adf2998

Please sign in to comment.