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. | ||||
| 
 | ||||
| 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 | ||||
| 
 | ||||
| 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 | ||||
| 
 | ||||
| [](https://godoc.org/github.com/reiver/go-opt) | ||||
| [](https://godoc.org/sourcecode.social/reiver/go-opt) | ||||
| 
 | ||||
| ## Examples | ||||
| 
 | ||||
| Here is an example **optional-type** that can hold a string: | ||||
| ```go | ||||
| import "sourcecode.social/reiver/go-opt" | ||||
| 
 | ||||
| // | ||||
| 
 | ||||
| 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 | ||||
|  |  | |||
|  | @ -1,7 +1,7 @@ | |||
| package opt_test | ||||
| 
 | ||||
| import ( | ||||
| 	"github.com/reiver/go-opt" | ||||
| 	"sourcecode.social/reiver/go-opt" | ||||
| 
 | ||||
| 	"testing" | ||||
| ) | ||||
|  |  | |||
|  | @ -1,7 +1,7 @@ | |||
| package opt_test | ||||
| 
 | ||||
| import ( | ||||
| 	"github.com/reiver/go-opt" | ||||
| 	"sourcecode.social/reiver/go-opt" | ||||
| 
 | ||||
| 	"testing" | ||||
| ) | ||||
|  |  | |||
|  | @ -1,7 +1,7 @@ | |||
| package opt_test | ||||
| 
 | ||||
| import ( | ||||
| 	"github.com/reiver/go-opt" | ||||
| 	"sourcecode.social/reiver/go-opt" | ||||
| 
 | ||||
| 	"testing" | ||||
| ) | ||||
|  |  | |||
|  | @ -1,7 +1,7 @@ | |||
| package opt_test | ||||
| 
 | ||||
| import ( | ||||
| 	"github.com/reiver/go-opt" | ||||
| 	"sourcecode.social/reiver/go-opt" | ||||
| 
 | ||||
| 	"fmt" | ||||
| 
 | ||||
|  |  | |||
|  | @ -1,7 +1,7 @@ | |||
| package opt_test | ||||
| 
 | ||||
| import ( | ||||
| 	"github.com/reiver/go-opt" | ||||
| 	"sourcecode.social/reiver/go-opt" | ||||
| 
 | ||||
| 	"testing" | ||||
| ) | ||||
|  |  | |||
|  | @ -1,7 +1,7 @@ | |||
| package opt_test | ||||
| 
 | ||||
| import ( | ||||
| 	"github.com/reiver/go-opt" | ||||
| 	"sourcecode.social/reiver/go-opt" | ||||
| 
 | ||||
| 	"testing" | ||||
| ) | ||||
|  |  | |||
|  | @ -1,7 +1,7 @@ | |||
| package opt_test | ||||
| 
 | ||||
| import ( | ||||
| 	"github.com/reiver/go-opt" | ||||
| 	"sourcecode.social/reiver/go-opt" | ||||
| 
 | ||||
| 	"testing" | ||||
| ) | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue