diff --git a/lesson8/07_type_parameter_check.go b/lesson8/07_type_parameter_check.go new file mode 100644 index 0000000..735f297 --- /dev/null +++ b/lesson8/07_type_parameter_check.go @@ -0,0 +1,18 @@ +// Strong type check applies there! + +package main + +import "fmt" + +func printValue[T any](value T) { + fmt.Println(value) +} + +func main() { + printValue[int]("www.root.cz") + printValue[[]string]('*') + printValue[string](42) + printValue[int](3.14) + printValue[byte](1 + 2i) + printValue[[]byte]([]int{1, 2, 3}) +}