github.com/reiver/go-opt -> sourcecode.social/reiver/go-opt

master
Charles Iliya Krempeaux 2023-09-23 05:40:21 +09:00
parent 89498dfdf6
commit df716e8fe0
9 changed files with 15 additions and 11 deletions

View File

@ -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
View File

@ -1,3 +1,3 @@
module github.com/reiver/go-opt module sourcecode.social/reiver/go-opt
go 1.18 go 1.18

View File

@ -1,7 +1,7 @@
package opt_test package opt_test
import ( import (
"github.com/reiver/go-opt" "sourcecode.social/reiver/go-opt"
"testing" "testing"
) )

View File

@ -1,7 +1,7 @@
package opt_test package opt_test
import ( import (
"github.com/reiver/go-opt" "sourcecode.social/reiver/go-opt"
"testing" "testing"
) )

View File

@ -1,7 +1,7 @@
package opt_test package opt_test
import ( import (
"github.com/reiver/go-opt" "sourcecode.social/reiver/go-opt"
"testing" "testing"
) )

View File

@ -1,7 +1,7 @@
package opt_test package opt_test
import ( import (
"github.com/reiver/go-opt" "sourcecode.social/reiver/go-opt"
"fmt" "fmt"

View File

@ -1,7 +1,7 @@
package opt_test package opt_test
import ( import (
"github.com/reiver/go-opt" "sourcecode.social/reiver/go-opt"
"testing" "testing"
) )

View File

@ -1,7 +1,7 @@
package opt_test package opt_test
import ( import (
"github.com/reiver/go-opt" "sourcecode.social/reiver/go-opt"
"testing" "testing"
) )

View File

@ -1,7 +1,7 @@
package opt_test package opt_test
import ( import (
"github.com/reiver/go-opt" "sourcecode.social/reiver/go-opt"
"testing" "testing"
) )