deprecated.go 768 B

123456789101112131415161718192021222324252627282930313233
  1. package toml
  2. import (
  3. "encoding"
  4. "io"
  5. )
  6. // DEPRECATED!
  7. //
  8. // Use the identical encoding.TextMarshaler instead. It is defined here to
  9. // support Go 1.1 and older.
  10. type TextMarshaler encoding.TextMarshaler
  11. // DEPRECATED!
  12. //
  13. // Use the identical encoding.TextUnmarshaler instead. It is defined here to
  14. // support Go 1.1 and older.
  15. type TextUnmarshaler encoding.TextUnmarshaler
  16. // DEPRECATED!
  17. //
  18. // Use MetaData.PrimitiveDecode instead.
  19. func PrimitiveDecode(primValue Primitive, v interface{}) error {
  20. md := MetaData{decoded: make(map[string]bool)}
  21. return md.unify(primValue.undecoded, rvalue(v))
  22. }
  23. // DEPRECATED!
  24. //
  25. // Use NewDecoder(reader).Decode(&v) instead.
  26. func DecodeReader(r io.Reader, v interface{}) (MetaData, error) {
  27. return NewDecoder(r).Decode(v)
  28. }