mirror of
https://github.com/kataras/iris.git
synced 2025-12-27 14:57:05 +00:00
add explanation why the 'globalVisitorsController' example is a Singleton, because it was not clear for new gophers previously.
Former-commit-id: 9267c415e53eeb00adadf6fde9e0aeeb415cf24a
This commit is contained in:
@@ -4,8 +4,11 @@ import "reflect"
|
||||
|
||||
var emptyIn = []reflect.Value{}
|
||||
|
||||
// IsZero returns true if a value is nil, remember boolean's false is zero.
|
||||
// IsZero returns true if a value is nil.
|
||||
// Remember; fields to be checked should be exported otherwise it returns false.
|
||||
// Notes for users:
|
||||
// Boolean's zero value is false, even if not set-ed.
|
||||
// UintXX are not zero on 0 because they are pointers to.
|
||||
func IsZero(v reflect.Value) bool {
|
||||
switch v.Kind() {
|
||||
case reflect.Struct:
|
||||
|
||||
Reference in New Issue
Block a user