From 44d3bc71edd5dc4b6edbba762009adb6f4de89a8 Mon Sep 17 00:00:00 2001 From: Nathan Coad Date: Tue, 16 Jan 2024 17:20:46 +1100 Subject: [PATCH] remove extra debug statements --- models/secret.go | 12 ++++++------ utils/structOperations.go | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/models/secret.go b/models/secret.go index 86e877e..da89db4 100644 --- a/models/secret.go +++ b/models/secret.go @@ -158,17 +158,17 @@ func SecretsGetAllowed(s *Secret, userId int) ([]UserSecret, error) { log.Printf("SecretsGetAllowed any error '%s'\n", rows.Err()) // parse all the results into a slice for rows.Next() { - log.Printf("SecretsGetAllowed processing row\n") + //log.Printf("SecretsGetAllowed processing row\n") var r UserSecret err = rows.StructScan(&r) - log.Printf("SecretsGetAllowed performed struct scan\n") + //log.Printf("SecretsGetAllowed performed struct scan\n") if err != nil { log.Printf("SecretsGetAllowed error parsing sql record : '%s'\n", 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 r.User.UserId = r.UserUserId @@ -177,7 +177,7 @@ func SecretsGetAllowed(s *Secret, userId int) ([]UserSecret, error) { debugPrint := utils.PrintStructContents(&r, 0) 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) //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 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)) } diff --git a/utils/structOperations.go b/utils/structOperations.go index 1b18913..ab93c56 100644 --- a/utils/structOperations.go +++ b/utils/structOperations.go @@ -72,7 +72,7 @@ func PrintStructContents(s interface{}, indentLevel int) string { case reflect.Struct: if fieldType.Type == reflect.TypeOf(time.Time{}) { // 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 { result.WriteString("\n") result.WriteString(PrintStructContents(field.Interface(), indentLevel+1))