improved homepage support, memory leak partial fix

This commit is contained in:
yusing
2024-10-03 20:02:43 +08:00
parent 4f09dbf044
commit de6c1be51b
7 changed files with 42 additions and 32 deletions

View File

@@ -110,6 +110,10 @@ func Copy(dst *ContextWriter, src *ContextReader) error {
return err
}
func Copy2(ctx context.Context, dst io.Writer, src io.Reader) error {
return Copy(&ContextWriter{ctx: ctx, Writer: dst}, &ContextReader{ctx: ctx, Reader: src})
}
func LoadJson[T any](path string, pointer *T) E.NestedError {
data, err := E.Check(os.ReadFile(path))
if err.HasError() {