this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

fakedata: use a switch (from review)

+5 -2
+5 -2
fakedata/accounts.go
··· 51 51 if err := decoder.Decode(&usr); err != nil { 52 52 return nil, fmt.Errorf("parse AccountContext: %w", err) 53 53 } 54 - if usr.AccountType == "celebrity" { 54 + switch usr.AccountType { 55 + case "celebrity": 55 56 catalog.Celebs = append(catalog.Celebs, usr) 56 - } else { 57 + case "regular": 57 58 catalog.Regulars = append(catalog.Regulars, usr) 59 + default: 60 + return nil, fmt.Errorf("unhandled account type: %v", usr.AccountType) 58 61 } 59 62 } 60 63 // validate index numbers