mirror of
https://github.com/yusing/godoxy.git
synced 2026-04-24 17:28:31 +02:00
refactor: refine byte pools usage and fix memory leak in rules
This commit is contained in:
@@ -8,6 +8,7 @@ import (
|
||||
|
||||
type templateOrStr interface {
|
||||
Execute(w io.Writer, data any) error
|
||||
Len() int
|
||||
}
|
||||
|
||||
type strTemplate string
|
||||
@@ -23,6 +24,10 @@ func (t strTemplate) Execute(w io.Writer, _ any) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (t strTemplate) Len() int {
|
||||
return len(t)
|
||||
}
|
||||
|
||||
type keyValueTemplate = Tuple[string, templateOrStr]
|
||||
|
||||
func executeRequestTemplateString(tmpl templateOrStr, r *http.Request) (string, error) {
|
||||
|
||||
Reference in New Issue
Block a user