GobEncode implements the gob interface.
()
| 150 | |
| 151 | // GobEncode implements the gob interface. |
| 152 | func (p *Path) GobEncode() ([]byte, error) { |
| 153 | b := bytes.Buffer{} |
| 154 | enc := gob.NewEncoder(&b) |
| 155 | if err := enc.Encode(p.d); err != nil { |
| 156 | return nil, err |
| 157 | } |
| 158 | return b.Bytes(), nil |
| 159 | } |
| 160 | |
| 161 | // GobDecode implements the gob interface. |
| 162 | func (p *Path) GobDecode(b []byte) error { |