You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

16 lines
262 B

11 years ago
11 years ago
11 years ago
  1. package binary
  2. import "io"
  3. type Binary interface {
  4. WriteTo(w io.Writer) (int64, error)
  5. }
  6. func WriteTo(b Binary, w io.Writer, n int64, err error) (int64, error) {
  7. if err != nil {
  8. return n, err
  9. }
  10. var n_ int64
  11. n_, err = b.WriteTo(w)
  12. return n + n_, err
  13. }