// Copyright 2014 The Gogs Authors. All rights reserved.// Use of this source code is governed by a MIT-style// license that can be found in the LICENSE file.packageauthimport("net/http""reflect""github.com/go-martini/martini""github.com/gogits/gogs/modules/base""github.com/gogits/gogs/modules/middleware/binding")typeCreateIssueFormstruct{IssueNamestring`form:"title" binding:"Required;MaxSize(50)"`MilestoneIdint64`form:"milestoneid"`AssigneeIdint64`form:"assigneeid"`Labelsstring`form:"labels"`Contentstring`form:"content"`}func(f*CreateIssueForm)Name(fieldstring)string{names:=map[string]string{"IssueName":"Issue name",}returnnames[field]}func(f*CreateIssueForm)Validate(errors*binding.Errors,req*http.Request,contextmartini.Context){data:=context.Get(reflect.TypeOf(base.TmplData{})).Interface().(base.TmplData)validate(errors,data,f)}