// RecognizesData implements the RecognizingDecoder interface. func (s *Serializer) RecognizesData(peek io.Reader) (bool, error) { _, ok := utilyaml.GuessJSONStream(peek, 2048) if s.yaml { return !ok, nil } return ok, nil }
// RecognizesData implements the RecognizingDecoder interface. func (s *Serializer) RecognizesData(peek io.Reader) (ok, unknown bool, err error) { if s.yaml { // we could potentially look for '---' return false, true, nil } _, ok = utilyaml.GuessJSONStream(peek, 2048) return ok, false, nil }