August 2021
Beginner
112 pages
1h 23m
English
| Puzzle 11 | What’s in a Log? |
| | package main |
| | |
| | import ( |
| | "fmt" |
| | "time" |
| | ) |
| | |
| | // Log is a log message |
| | type Log struct { |
| | Message string |
| | time.Time |
| | } |
| | |
| | func main() { |
| | ts := time.Date(2009, 11, 10, 0, 0, 0, 0, time.UTC) |
| | log := Log{"Hello", ts} |
| | fmt.Printf("%v\n", log) |
| | } |
Guess the Output | |
|---|---|
|
|
Try to guess what the output is before moving to the next page. |
This code will print: 2009-11-10 00:00:00 +0000 UTC
The ...
Read now
Unlock full access