added yamltool sort

This commit is contained in:
Erik Brakkee committed 2026-03-08 15:39:52 +01:00
1 parent 6162670570
commit ebf888d91d
7 files changed
+259 -20

No files matched your search

+23
View File
@@ -0,0 +1,23 @@
package main
import (
"fmt"
"io"
"os"
)
func read(file string) ([]byte, error) {
if file == "-" {
data, err := io.ReadAll(os.Stdin)
if err != nil {
return nil, fmt.Errorf("Error reading from stdin")
}
return data, nil
}
data, err := os.ReadFile(file)
if err != nil {
return nil, fmt.Errorf("Error reading from '%s'", file)
}
return data, nil
}