1
1
mirror of https://github.com/go-gitea/gitea synced 2025-08-06 17:48:19 +00:00

enforce explanation for necessary nolints and fix bugs (#34883)

Follows up https://github.com/go-gitea/gitea/pull/34851

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
This commit is contained in:
TheFox0x7
2025-06-27 15:48:03 +02:00
committed by GitHub
parent 9854df3e87
commit aa9d86745a
48 changed files with 83 additions and 159 deletions

View File

@@ -102,31 +102,28 @@ func escapeTemplate(t *template.Template) error {
return nil
}
//nolint:unused
type htmlTemplate struct {
escapeErr error
text *texttemplate.Template
_/*escapeErr*/ error
text *texttemplate.Template
}
//nolint:unused
type textTemplateCommon struct {
tmpl map[string]*template.Template // Map from name to defined templates.
muTmpl sync.RWMutex // protects tmpl
option struct {
_/*tmpl*/ map[string]*template.Template
_/*muTmpl*/ sync.RWMutex
_/*option*/ struct {
missingKey int
}
muFuncs sync.RWMutex // protects parseFuncs and execFuncs
parseFuncs texttemplate.FuncMap
execFuncs map[string]reflect.Value
muFuncs sync.RWMutex
_/*parseFuncs*/ texttemplate.FuncMap
execFuncs map[string]reflect.Value
}
//nolint:unused
type textTemplate struct {
name string
_/*name*/ string
*parse.Tree
*textTemplateCommon
leftDelim string
rightDelim string
_/*leftDelim*/ string
_/*rightDelim*/ string
}
func ptr[T, P any](ptr *P) *T {