Files
zeekay 1943f1c093 Hanzo Commerce
Multi-tenant commerce and billing: orders, subscriptions, invoices, plans,
usage metering and a credit ledger. One Go binary. MIT OR Apache-2.0.

Claude-Session: https://claude.ai/code/session_01SAtaDFm8VDiWrhYHNNtxMw
2026-09-23 21:52:16 -07:00

32 lines
472 B
Go

package fs
import (
"io/ioutil"
"log"
"strings"
)
func ReadFile(path string) []byte {
dat, err := ioutil.ReadFile(path)
if err != nil {
log.Fatalln(err)
}
return dat
}
func SplitLines(s string) []string {
return strings.Split(s, "\n")
}
func ReadLines(path string) []string {
return SplitLines(string(ReadFile(path)))
}
func WriteFile(path string, data string) {
err := ioutil.WriteFile(path, []byte(data), 0644)
if err != nil {
log.Fatalln(err)
}
}