From e3a3949959f3223ec69f2c60d4e620f8653dc2ff Mon Sep 17 00:00:00 2001 From: xengineering Date: Fri, 8 Nov 2024 16:58:52 +0100 Subject: Add main.go with generic Optional definition This is the core of the optional package. --- optional/main.go | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 optional/main.go diff --git a/optional/main.go b/optional/main.go new file mode 100644 index 0000000..6cc494a --- /dev/null +++ b/optional/main.go @@ -0,0 +1,6 @@ +package optional + +type Optional[T any] struct { + Value T + Exists bool +} -- cgit v1.2.3-70-g09d2