summaryrefslogtreecommitdiff
path: root/main.go
diff options
context:
space:
mode:
authorThomas Schneider <qsx@chaotikum.eu>2025-12-04 17:26:50 +0100
committerThomas Schneider <qsx@chaotikum.eu>2025-12-04 17:26:50 +0100
commitf65158124dad22f8863768fb38260573ab37fa2d (patch)
tree126d3d9aeaaf385e430464d9a62d0407e577027b /main.go
Initial importHEADmain
Diffstat (limited to 'main.go')
-rw-r--r--main.go11
1 files changed, 11 insertions, 0 deletions
diff --git a/main.go b/main.go
new file mode 100644
index 0000000..947d028
--- /dev/null
+++ b/main.go
@@ -0,0 +1,11 @@
+package demo
+
+import "golang.org/x/exp/constraints"
+
+type Number interface {
+ constraints.Integer | constraints.Float
+}
+
+func Add[T Number](a, b T) T {
+ return a + b
+}