v0.16.0 import PGN, delete games, two-layout web client
test / test (push) Canceled after 0s
test / e2e (push) Canceled after 0s

This commit is contained in:
lixen committed 2026-10-19 21:02:39 -04:00
1 parent e1fa5242e3
commit 664cf9654e
34 files changed
+2007 -150

No files matched your search

+26
View File
@@ -0,0 +1,26 @@
//go:build !js && !wasm
package command
import (
"fmt"
"os"
)
const maxImportFile = 64 << 10
// readImportFile reads a PGN file for import.
func readImportFile(path string) (string, error) {
info, err := os.Stat(path)
if err != nil {
return "", err
}
if info.Size() > maxImportFile {
return "", fmt.Errorf("%s is larger than %d bytes", path, maxImportFile)
}
data, err := os.ReadFile(path)
if err != nil {
return "", err
}
return string(data), nil
}