From f7c6b1e2b530b249f9438616f68a94edfd318f1b Mon Sep 17 00:00:00 2001 From: Pavel Tisnovsky Date: Mon, 13 Jun 2022 08:50:50 +0200 Subject: [PATCH] Example #8: comparable type set --- lesson8/08_comparable.go | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 lesson8/08_comparable.go diff --git a/lesson8/08_comparable.go b/lesson8/08_comparable.go new file mode 100644 index 0000000..4098f1c --- /dev/null +++ b/lesson8/08_comparable.go @@ -0,0 +1,13 @@ +// The good old "compare" function defined for one data type. + +package main + +import "fmt" + +func compare(x int, y int) bool { + return x < y +} + +func main() { + fmt.Println(compare(1, 2)) +}