Skip to content

Commit 569e995

Browse files
committed
Minor refactor
1 parent 41d17e1 commit 569e995

File tree

3 files changed

+3
-5
lines changed

3 files changed

+3
-5
lines changed

option/json.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,6 @@ func (o *Option[T]) UnmarshalJSON(data []byte) error {
3333
}
3434

3535
var (
36-
_ json.Unmarshaler = &Option[struct{}]{}
36+
_ json.Unmarshaler = new(Option[struct{}])
3737
_ json.Marshaler = Option[struct{}]{}
3838
)

result/json.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@ func (r *Result[T]) UnmarshalJSON(data []byte) error {
1515
return nil
1616
}
1717

18-
var _ json.Unmarshaler = &Result[struct{}]{}
18+
var _ json.Unmarshaler = new(Result[struct{}])

result/result.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
package result
22

3-
import (
4-
"fmt"
5-
)
3+
import "fmt"
64

75
// Result represents failure or success. The [Ok] variant represents success
86
// and contains a value. The [Err] variant represent a failure and contains an

0 commit comments

Comments
 (0)