added docs
parent
266d3f6da4
commit
40c8fd548d
36
doc.go
36
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
|
||||
|
||||
|
|
Loading…
Reference in New Issue