code: func (gm *serverMethod) setup(apiDef *raml.APIDefinition, r *raml.Resource, rd *resource.Resource, methodName string) error {
  	gm.MethodName = strings.Title(serverMethodName(gm.Endpoint, gm.DisplayName, methodName, rd.Name))
  
  	// setting middlewares
  	middlewares := []string{}
  
  	// security middlewares
  	for _, v := range gm.SecuredBy {
  		if !security.ValidateScheme(v.Name, apiDef) {
  			continue
  		}
  		// oauth2 middleware
  		m, err := getOauth2MwrHandler(v)
  		if err != nil {
  			return err
  		}
  		middlewares = append(middlewares, m)
  	}
  
  	gm.Middlewares = strings.Join(middlewares, ", ")
  
  	return nil
  }
docs: // setup go server method, initializes all needed variables