1
0
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:
Gerasimos (Makis) Maropoulos
2017-12-20 18:09:31 +02:00
parent 2042fddb66
commit 254a4ede95
2 changed files with 12 additions and 6 deletions

View File

@@ -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: