mirror of
https://github.com/samuelncui/acp.git
synced 2026-11-08 04:21:16 +00:00
Simplify indexed copy facts and unify staged output completion. Fix cleanup, rewrite persistence, native paths, and terminal reporting. Maintain compatibility, upstream notices, and automated release checks.
17 lines
329 B
Go
17 lines
329 B
Go
package fileio
|
|
|
|
import (
|
|
"fmt"
|
|
"unicode/utf8"
|
|
)
|
|
|
|
// CheckJSONPaths refuses paths that encoding/json would silently change to different names.
|
|
func CheckJSONPaths(paths ...string) error {
|
|
for _, path := range paths {
|
|
if !utf8.ValidString(path) {
|
|
return fmt.Errorf("path is not valid UTF-8: %q", path)
|
|
}
|
|
}
|
|
return nil
|
|
}
|