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.
 

40 lines
434 B

package main
import "fmt"
type point struct {
x int
y int
}
func compare() (bool, bool) {
point1 := struct {
x int
y int
}{
10,
10,
}
point2 := struct {
x int
y int
}{}
point2.x = 10
point2.y = 5
point3 := point{10, 10}
return point1 == point2, point1 == point3
}
func main() {
a, b := compare()
fmt.Println("point1 == point2:", a)
fmt.Println("point1 == point3:", b)
}