Skip to content

Commit

Permalink
Merge pull request #851 from abyssparanoia/fix/nullable-package
Browse files Browse the repository at this point in the history
fix: nullable package
  • Loading branch information
abyssparanoia authored Aug 11, 2023
2 parents 9bff289 + ba28ef1 commit 3cb00de
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ localstack/cognito/.cognito
db/main/erd/src
db/redis/dump.rdb
sqlboiler.toml
test-script/test-run/*

### https://raw.github.com/github/gitignore/f9291de89f5f7dc0d3d87f9eb111b839f81d5dbc/Node.gitignore

Expand Down
3 changes: 2 additions & 1 deletion internal/pkg/nullable/nullable.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ func TypeFrom[T any](v T) Type[T] {

func TypeFromPtr[T any](v *T) Type[T] {
if v == nil {
return NewType(*v, false)
var zeroValue T
return NewType(zeroValue, false)
}
return NewType(*v, true)
}
Expand Down

0 comments on commit 3cb00de

Please sign in to comment.