From 691a4a8c544ac177362684ab1f3a0dff2dfd2ce7 Mon Sep 17 00:00:00 2001 From: Manuel Carbajal Date: Fri, 12 Apr 2024 00:52:38 -0600 Subject: [PATCH] feat: add echo binder implementation --- echo.go | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 echo.go diff --git a/echo.go b/echo.go new file mode 100644 index 0000000..a3f43ca --- /dev/null +++ b/echo.go @@ -0,0 +1,10 @@ +package goption + +import ( + "fmt" +) + +func (cb *Optional[T]) UnmarshalText(text []byte) error { + return cb.UnmarshalJSON([]byte(fmt.Sprintf("\"%s\"", text))) + +}