remove extra debug statements
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2024-01-16 17:20:46 +11:00
parent dc3c5d1068
commit 44d3bc71ed
2 changed files with 7 additions and 7 deletions

View File

@@ -158,17 +158,17 @@ func SecretsGetAllowed(s *Secret, userId int) ([]UserSecret, error) {
log.Printf("SecretsGetAllowed any error '%s'\n", rows.Err()) log.Printf("SecretsGetAllowed any error '%s'\n", rows.Err())
// parse all the results into a slice // parse all the results into a slice
for rows.Next() { for rows.Next() {
log.Printf("SecretsGetAllowed processing row\n") //log.Printf("SecretsGetAllowed processing row\n")
var r UserSecret var r UserSecret
err = rows.StructScan(&r) err = rows.StructScan(&r)
log.Printf("SecretsGetAllowed performed struct scan\n") //log.Printf("SecretsGetAllowed performed struct scan\n")
if err != nil { if err != nil {
log.Printf("SecretsGetAllowed error parsing sql record : '%s'\n", err) log.Printf("SecretsGetAllowed error parsing sql record : '%s'\n", err)
return secretResults, err return secretResults, err
} }
log.Printf("r: %v\n", r) //log.Printf("r: %v\n", r)
log.Printf("SecretsGetAllowed performed err check\n") //log.Printf("SecretsGetAllowed performed err check\n")
// work around to get the UserId populated in the User field of the struct // work around to get the UserId populated in the User field of the struct
r.User.UserId = r.UserUserId r.User.UserId = r.UserUserId
@@ -177,7 +177,7 @@ func SecretsGetAllowed(s *Secret, userId int) ([]UserSecret, error) {
debugPrint := utils.PrintStructContents(&r, 0) debugPrint := utils.PrintStructContents(&r, 0)
log.Println(debugPrint) log.Println(debugPrint)
log.Printf("SecretsGetAllowed performed debug print\n") //log.Printf("SecretsGetAllowed performed debug print\n")
// Append the secrets to the query output, don't decrypt the secrets (we didn't SELECT them anyway) // Append the secrets to the query output, don't decrypt the secrets (we didn't SELECT them anyway)
//secretResults = append(secretResults, r) //secretResults = append(secretResults, r)
@@ -187,7 +187,7 @@ func SecretsGetAllowed(s *Secret, userId int) ([]UserSecret, error) {
// if there is already a secret with the same ID present // if there is already a secret with the same ID present
secretResults = utils.AppendIfNotExists(secretResults, r) secretResults = utils.AppendIfNotExists(secretResults, r)
log.Printf("SecretsGetAllowed added secret results\n") //log.Printf("SecretsGetAllowed added secret results\n")
} }
log.Printf("SecretsGetAllowed retrieved '%d' results\n", len(secretResults)) log.Printf("SecretsGetAllowed retrieved '%d' results\n", len(secretResults))
} }

View File

@@ -72,7 +72,7 @@ func PrintStructContents(s interface{}, indentLevel int) string {
case reflect.Struct: case reflect.Struct:
if fieldType.Type == reflect.TypeOf(time.Time{}) { if fieldType.Type == reflect.TypeOf(time.Time{}) {
// Handle time.Time field // Handle time.Time field
result.WriteString(fmt.Sprintf("%v\n", field.Interface().(time.Time).Format("2006-01-02 15:04:05"))) result.WriteString(fmt.Sprintf("%v\n", field.Interface().(time.Time).Format("2006-12-24 15:04:05")))
} else { } else {
result.WriteString("\n") result.WriteString("\n")
result.WriteString(PrintStructContents(field.Interface(), indentLevel+1)) result.WriteString(PrintStructContents(field.Interface(), indentLevel+1))