From 40c8fd548d6afa7043528a707370ed3630b2fb75 Mon Sep 17 00:00:00 2001 From: Charles Iliya Krempeaux Date: Thu, 18 May 2017 11:56:21 -0700 Subject: [PATCH] added docs --- doc.go | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/doc.go b/doc.go index d201914..0a36449 100644 --- a/doc.go +++ b/doc.go @@ -2,6 +2,42 @@ Package opt has a number of sub-packages provides alternatives to Go's built-in types (bool, float64, int64, string, time.Time) that also let you express a "lack of a value"; for the Go programming language; these are similar to "option types" or "maybe types" in some other programming languages. + +Example: + + var s optstring.NullableType + + // ... + + switch s { + case optstring.NoneNullable(): + //@TODO + case optstring.Null(): + //@TODO + case optstring.SomeNullable("Hello world!"): + //@TODO + case optstring.SomeNullable("apple banana cherry"): + //@TODO + default: + //@TODO + } + +Example: + + var s optstring.Type + + // ... + + switch s { + case optstring.None(): + //@TODO + case optstring.Some("Hello world!"): + //@TODO + case optstring.Some("apple banana cherry"): + //@TODO + default: + //@TODO + } */ package opt