mirror of
https://github.com/mainnika/mongox-go-driver.git
synced 2026-05-23 00:03:36 +00:00
Use named returns for the code style consistency
This commit is contained in:
@@ -5,7 +5,7 @@ import (
|
||||
)
|
||||
|
||||
// IsNil function evaluates the interface value to nil
|
||||
func IsNil(i interface{}) bool {
|
||||
func IsNil(i interface{}) (isNil bool) {
|
||||
|
||||
type iface struct {
|
||||
_ unsafe.Pointer
|
||||
@@ -14,8 +14,10 @@ func IsNil(i interface{}) bool {
|
||||
|
||||
unpacked := (*iface)(unsafe.Pointer(&i))
|
||||
if unpacked.ptr == nil {
|
||||
return true
|
||||
isNil = true
|
||||
return
|
||||
}
|
||||
|
||||
return *(*unsafe.Pointer)(unpacked.ptr) == nil
|
||||
isNil = *(*unsafe.Pointer)(unpacked.ptr) == nil
|
||||
return
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user