Skip to content

Commit b99da22

Browse files
chore(format): auto-format code [skip ci]
1 parent d9be610 commit b99da22

2 files changed

Lines changed: 4 additions & 7 deletions

File tree

internal/exercises/solutions/36_epoch/epoch.go

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,6 @@ func GetCurrentFormattedTimeSimple() string {
3333
return time.Now().UTC().Format("2006-01-02 15:04:05 +0000 UTC")
3434
}
3535

36-
37-
3836
// EpochToTime converts a unix epoch (seconds) into a formatted time string "2006-01-02 15:04:05".
3937
// The resulting time is in UTC.
4038
func EpochToTime(epoch int64) string {
@@ -52,13 +50,12 @@ func TimeToEpoch(input string) int64 {
5250
return t.Unix()
5351
}
5452

55-
5653
// NowFormats returns the current time in all supported formats.
5754
func NowFormats() map[string]string {
5855
now := time.Now().UTC()
5956
return map[string]string{
60-
"UnixSeconds": time.Unix(now.Unix(), 0).Format("2006-01-02 15:04:05") + " (epoch: " +
61-
time.Unix(now.Unix(), 0).UTC().Format("2006-01-02 15:04:05") + ")",
57+
"UnixSeconds": time.Unix(now.Unix(), 0).Format("2006-01-02 15:04:05") + " (epoch: " +
58+
time.Unix(now.Unix(), 0).UTC().Format("2006-01-02 15:04:05") + ")",
6259
"UnixSecondsRaw": time.Unix(now.Unix(), 0).UTC().Format("2006-01-02 15:04:05"),
6360
"UnixSecondsInt": formatInt(now.Unix()),
6461
"UnixMilliseconds": formatInt(now.UnixMilli()),
@@ -71,4 +68,4 @@ func NowFormats() map[string]string {
7168
// Helper: format int64 as string
7269
func formatInt(val int64) string {
7370
return time.Unix(0, val).UTC().Format("2006-01-02 15:04:05")
74-
}
71+
}

internal/exercises/templates/36_epoch/epoch_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,4 @@ func TestTimeToEpoch(t *testing.T) {
1717
if got != want {
1818
t.Fatalf("TimeToEpoch(%q) = %d, want %d", input, got, want)
1919
}
20-
}
20+
}

0 commit comments

Comments
 (0)