code: func isDoc(val reflect.Value) bool {
  	iterations := 0
  	for val.Kind() == reflect.Interface || val.Kind() == reflect.Ptr {
  		val = val.Elem()
  		// preventing cycles
  		iterations++
  		if iterations > 10 {
  			return false
  		}
  	}
  	return val.Kind() == reflect.Struct || val.Kind() == reflect.Map
  }
docs: // isDoc detects whether value constitues a document