From be51cb0c773fbe8752e1e1e4d1f3ceae56fbcd37 Mon Sep 17 00:00:00 2001 From: Emile Date: Sun, 20 Oct 2019 00:38:04 +0200 Subject: formatting --- src/challenge.go | 60 ++++++++++++++++++++++++++++---------------------------- 1 file changed, 30 insertions(+), 30 deletions(-) (limited to 'src') diff --git a/src/challenge.go b/src/challenge.go index 3fb26d7..547a5c8 100644 --- a/src/challenge.go +++ b/src/challenge.go @@ -3,53 +3,53 @@ package main import "time" type Challenge struct { - Name string + Name string Description string - Flag string // this should never leave the server - FoundFlag time.Time - FlagTries uint - Container string // this could, but is not required as well - Category string - Points int + Flag string // this should never leave the server + FoundFlag time.Time + FlagTries uint + Container string // this could, but is not required as well + Category string + Points int } // 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 int64 `json:"foundFlag"` - FlagTries uint `json:"flagTries"` - ContainsLaunchable bool `json:"ContainsLaunchable"` - IPAddress string `json:"IPAddress"` - Points int `json:"points"` + Name string `json:"name"` + Description string `json:"description"` + Category string `json:"category"` + FoundFlag int64 `json:"foundFlag"` + FlagTries uint `json:"flagTries"` + ContainsLaunchable bool `json:"ContainsLaunchable"` + IPAddress string `json:"IPAddress"` + Points int `json:"points"` } type StatsStrippedChallenge struct { - Name string `json:"name"` - FoundFlag int64 `json:"foundFlag"` - FlagTries uint `json:"flagTries"` - Points int `json:"points"` + Name string `json:"name"` + FoundFlag int64 `json:"foundFlag"` + FlagTries uint `json:"flagTries"` + Points int `json:"points"` } -func stripChallenge(c Challenge) (StrippedChallenge) { +func stripChallenge(c Challenge) StrippedChallenge { return StrippedChallenge{ - Name: c.Name, - Description: c.Description, - Category: c.Category, - FoundFlag: c.FoundFlag.Unix(), - FlagTries: c.FlagTries, + Name: c.Name, + Description: c.Description, + Category: c.Category, + FoundFlag: c.FoundFlag.Unix(), + FlagTries: c.FlagTries, ContainsLaunchable: c.Container != "", - IPAddress: getAddressForChallengeContainer(c.Container), - Points: c.Points, + IPAddress: getAddressForChallengeContainer(c.Container), + Points: c.Points, } } -func stripChallengeForStatistics(c Challenge) (StatsStrippedChallenge) { +func stripChallengeForStatistics(c Challenge) StatsStrippedChallenge { return StatsStrippedChallenge{ - Name: c.Name, + Name: c.Name, FoundFlag: c.FoundFlag.Unix(), FlagTries: c.FlagTries, - Points: c.Points, + Points: c.Points, } } -- cgit 1.4.1