code: func findTarget(val reflect.Value, target reflect.Type) (int, reflect.Value) {
  	// Look through the embedded types (until we reach the *revel.Controller at the top).
  	valueQueue := []reflect.Value{val}
  	level := 0
  	for len(valueQueue) > 0 {
  		val, valueQueue = valueQueue[0], valueQueue[1:]
  
  		// Check if val is of a similar type to the target type.
  		if val.Type() == target {
  			return level, val
  		}
  		if val.Kind() == reflect.Ptr && val.Elem().Type() == target {
  			return level, val.Elem()
  		}
  		if target.Kind() == reflect.Ptr && target.Elem() == val.Type() {
  			return level, val.Addr()
  		}
  
  		// If we reached the *revel.Controller and still didn't find what we were
  		// looking for, give up.
  		if val.Type() == controllerPtrType {
  			continue
  		}
  
  		// Else, add each anonymous field to the queue.
  		if val.Kind() == reflect.Ptr {
  			val = val.Elem()
  		}
  
  		for i := 0; i < val.NumField(); i++ {
  			if val.Type().Field(i).Anonymous {
  				valueQueue = append(valueQueue, val.Field(i))
  			}
  		}
  		level--
  	}
  
  	return level, reflect.Value{}
  }
docs: // Find the value of the target, starting from val and including embedded types.
  // Also, convert between any difference in indirection.
  // If the target couldn't be found, the returned Value will have IsValid() == false