diff --git a/models/secret.go b/models/secret.go index 85c2c9f..b930478 100644 --- a/models/secret.go +++ b/models/secret.go @@ -31,7 +31,7 @@ type Secret struct { // Since there are some ambiguous column names (eg UserName is present in both users and secrets table), the order of fields in this struct matters type UserSecret struct { Secret - UserId int `db:"UserUserId"` + UserUserId int `db:"UserUserId"` User //Group Permission @@ -133,6 +133,9 @@ func SecretsGetAllowed(s *Secret, userId int) ([]UserSecret, error) { return secretResults, err } //log.Printf("r: %v\n", r) + + // work around to get the UserId populated in the User field of the struct + r.User.UserId = r.UserUserId debugPrint := utils.PrintStructContents(&r, 0) log.Println(debugPrint)