package config import ( "bytes" "gopkg.in/yaml.v3" ) // unmarshalStrict decodes YAML into v and rejects unknown fields, so a typo // in warp.yaml fails the boot instead of being silently ignored. func unmarshalStrict(data []byte, v any) error { dec := yaml.NewDecoder(bytes.NewReader(data)) dec.KnownFields(true) if err := dec.Decode(v); err != nil { // An empty file decodes to io.EOF; treat it as "all defaults". if err.Error() == "EOF" { return nil } return err } return nil }