79132902

Date: 2024-10-28 10:13:54
Score: 1.5
Natty:
Report link

Did you post full code ? It seems that you created map "Users" (capitalized) but you are trying to access that map with lowercase "users" in main.go. Maybe I'm missing something? Also, maybe don't use same name for struct and map (name it UserMap or something similar) to avoid confusion.

var UserMap = map[string]*User{
    "john": {Username: "john", Password: "123", Secret: ""},
}

user, ok := users.UserMap[username]
Reasons:
  • Has code block (-0.5):
  • Contains question mark (0.5):
  • Starts with a question (0.5): Did you post
  • Low reputation (1):
Posted by: Big Fudge 1337