Exercises & activities from the go workshop provided by Packt: https://courses.packtpub.com/courses/go
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 

30 lines
455 B

package main
import (
"fmt"
"time"
)
func main() {
var count1 *int
count2 := new(int)
countTemp := 5
count3 := &countTemp
t := &time.Time{}
if count1 != nil {
fmt.Printf("count1: %#v\n", *count1)
}
if count2 != nil {
fmt.Printf("count2: %#v\n", *count2)
}
if count3 != nil {
fmt.Printf("count3: %#v\n", *count3)
}
if t != nil {
fmt.Printf("time: %#v\n", *t)
fmt.Printf("time: %#v\n", t.String())
}
}