package main type Challenge struct { Name string Description string Flag string // this should never leave the server FoundFlag bool FlagTries uint Container string // this could, but is not required as well Category string } // TODO: The name "Stripped" is a bit inaccurate now. Rename. type StrippedChallenge struct { Name string `json:"name"` Description string `json:"description"` Category string `json:"category"` FoundFlag bool `json:"foundFlag"` ContainsLaunchable bool `json:"ContainsLaunchable"` IPAddress string `json:"IPAddress"` } func stripChallenge(c Challenge) (StrippedChallenge) { return StrippedChallenge{ Name: c.Name, Description: c.Description, Category: c.Category, FoundFlag: c.FoundFlag, ContainsLaunchable: c.Container != "", IPAddress: getAddressForChallengeContainer(c.Container), } }