func GetOk(p interface{}) (interface{}, bool) {
	t := reflect.TypeOf(p)

	// if p is a non-pointer, just return it
	if t.Kind() != reflect.Ptr {
		return p, true
	}

	// p is a pointer.  If non-nil, return the value pointed to
	v := reflect.Indirect(reflect.ValueOf(p))
	if v.IsValid() {
		return v.Interface(), true
	}

	// p is a nil pointer.  Return the zero value for the pointed-to type
	return reflect.Zero(t.Elem()).Interface(), false
}
// GetOk returns the value of p, either p itself, or, if p is a pointer, the
// value that p points to. If d is not specified, and p is nil, a type-
// appropriate zero-value is returned instead. If p is a value or non-nil
// pointer, the second return value will be true.  Otherwise, it will be false
GetOk returns the value of p, either p itself, or, if p is a pointer, the
value that p points to. If d is not specified, and p is nil, a type
appropriate zero-value is returned instead. If p is a value or non-nil
pointer, the second return value will be true.  Otherwise, it will be false
// GetOk returns the value of p either p itself or if p is a pointer the // value that p points to . If d is not specified and p is nil a type - // appropriate zero - value is returned instead . If p is a value or non - nil // pointer the second return value will be true . Otherwise it will be false
func GetOk(p interface{}) (interface{}, bool) {
	t := reflect.TypeOf(p)
	if t.Kind() != reflect.Ptr {
		return p, true
	}
	v := reflect.Indirect(reflect.ValueOf(p))
	if v.IsValid() {
		return v.Interface(), true
	}
	return reflect.Zero(t.Elem()).Interface(), false
}
func GetOk ( p interface { } ) ( interface { } , bool ) { t := reflect . TypeOf ( p ) if t . Kind ( ) != reflect . Ptr { return p , true } v := reflect . Indirect ( reflect . ValueOf ( p ) ) if v . IsValid ( ) { return v . Interface ( ) , true } return reflect . Zero ( t . Elem ( ) ) . Interface ( ) , false }
GetOk returns the value of p, either p itself, or, if p is a pointer, the
value that p points to.
GetOk returns the value of p either p itself or if p is a pointer the value that p points to .
// if p is a non-pointer, just return it // p is a pointer.  If non-nil, return the value pointed to // p is a nil pointer.  Return the zero value for the pointed-to type