Bonus Fields Need *int not any
This commit is contained in:
8
helpers/nullable.go
Normal file
8
helpers/nullable.go
Normal file
@@ -0,0 +1,8 @@
|
||||
package helpers
|
||||
|
||||
func Nullable(val int) *int {
|
||||
if val == 0 {
|
||||
return nil
|
||||
}
|
||||
return &val
|
||||
}
|
||||
Reference in New Issue
Block a user