github.com/reiver/go-opt -> sourcecode.social/reiver/go-opt
parent
89498dfdf6
commit
df716e8fe0
10
README.md
10
README.md
|
@ -2,18 +2,22 @@
|
||||||
|
|
||||||
Package **opt** implements an **optional-type**, for the Go programming language.
|
Package **opt** implements an **optional-type**, for the Go programming language.
|
||||||
|
|
||||||
In other programming languages, an **optional-type** might be know as: a **option type**, or a **maybe type**.
|
In other programming languages, an **optional-type** might be know as: a **option-type**, or a **maybe-type**.
|
||||||
|
|
||||||
## Documention
|
## Documention
|
||||||
|
|
||||||
Online documentation, which includes examples, can be found at: http://godoc.org/github.com/reiver/go-opt
|
Online documentation, which includes examples, can be found at: http://godoc.org/sourcecode.social/reiver/go-opt
|
||||||
|
|
||||||
[![GoDoc](https://godoc.org/github.com/reiver/go-opt?status.svg)](https://godoc.org/github.com/reiver/go-opt)
|
[![GoDoc](https://godoc.org/sourcecode.social/reiver/go-opt?status.svg)](https://godoc.org/sourcecode.social/reiver/go-opt)
|
||||||
|
|
||||||
## Examples
|
## Examples
|
||||||
|
|
||||||
Here is an example **optional-type** that can hold a string:
|
Here is an example **optional-type** that can hold a string:
|
||||||
```go
|
```go
|
||||||
|
import "sourcecode.social/reiver/go-opt"
|
||||||
|
|
||||||
|
//
|
||||||
|
|
||||||
var op opt.Optional[string] // the default value is nothing.
|
var op opt.Optional[string] // the default value is nothing.
|
||||||
|
|
||||||
// ...
|
// ...
|
||||||
|
|
2
go.mod
2
go.mod
|
@ -1,3 +1,3 @@
|
||||||
module github.com/reiver/go-opt
|
module sourcecode.social/reiver/go-opt
|
||||||
|
|
||||||
go 1.18
|
go 1.18
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
package opt_test
|
package opt_test
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/reiver/go-opt"
|
"sourcecode.social/reiver/go-opt"
|
||||||
|
|
||||||
"testing"
|
"testing"
|
||||||
)
|
)
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
package opt_test
|
package opt_test
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/reiver/go-opt"
|
"sourcecode.social/reiver/go-opt"
|
||||||
|
|
||||||
"testing"
|
"testing"
|
||||||
)
|
)
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
package opt_test
|
package opt_test
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/reiver/go-opt"
|
"sourcecode.social/reiver/go-opt"
|
||||||
|
|
||||||
"testing"
|
"testing"
|
||||||
)
|
)
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
package opt_test
|
package opt_test
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/reiver/go-opt"
|
"sourcecode.social/reiver/go-opt"
|
||||||
|
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
package opt_test
|
package opt_test
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/reiver/go-opt"
|
"sourcecode.social/reiver/go-opt"
|
||||||
|
|
||||||
"testing"
|
"testing"
|
||||||
)
|
)
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
package opt_test
|
package opt_test
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/reiver/go-opt"
|
"sourcecode.social/reiver/go-opt"
|
||||||
|
|
||||||
"testing"
|
"testing"
|
||||||
)
|
)
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
package opt_test
|
package opt_test
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/reiver/go-opt"
|
"sourcecode.social/reiver/go-opt"
|
||||||
|
|
||||||
"testing"
|
"testing"
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in New Issue