Skip to content

Commit

Permalink
Merge pull request #13 from zhenfeng-zhu/doc-typo
Browse files Browse the repository at this point in the history
Fix some doc typo and remove unused code
  • Loading branch information
samber committed Oct 7, 2022
2 parents 0519702 + e85639c commit 42c77f3
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 5 deletions.
4 changes: 2 additions & 2 deletions future.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ func (f *Future[T]) reject(err error) {
}
}

// Catch is called when Future is resolved. It returns a new Future.
// Then is called when Future is resolved. It returns a new Future.
func (f *Future[T]) Then(cb func(T) (T, error)) *Future[T] {
f.mu.Lock()
defer f.mu.Unlock()
Expand Down Expand Up @@ -171,7 +171,7 @@ func (f *Future[T]) Result() Result[T] {
return TupleToResult(f.Collect())
}

// Result wraps Collect and returns a Result.
// Either wraps Collect and returns a Either.
func (f *Future[T]) Either() Either[error, T] {
v, err := f.Collect()
if err != nil {
Expand Down
2 changes: 0 additions & 2 deletions option.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import (
"errors"
"fmt"
"reflect"
"time"
)

var optionNoSuchElement = fmt.Errorf("no such element")
Expand Down Expand Up @@ -186,7 +185,6 @@ func (o *Option[T]) UnmarshalJSON(b []byte) error {
}

o.isPresent = true
time.Now()
return nil
}

Expand Down
2 changes: 1 addition & 1 deletion result.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ func (r Result[T]) Error() error {
return r.err
}

// MustGet returns value and error.
// Get returns value and error.
// Play: https://go.dev/play/p/8KyX3z6TuNo
func (r Result[T]) Get() (T, error) {
if r.isErr {
Expand Down

0 comments on commit 42c77f3

Please sign in to comment.