编码
(value interface{})
| 17 | |
| 18 | //编码 |
| 19 | func Encode(value interface{}) (string,error) { |
| 20 | network:= bytes.NewBuffer(nil); |
| 21 | |
| 22 | enc := gob.NewEncoder(network) |
| 23 | |
| 24 | err := enc.Encode(value); |
| 25 | if err != nil { |
| 26 | return "",err; |
| 27 | } |
| 28 | |
| 29 | return network.String(),nil; |
| 30 | } |
no outgoing calls
no test coverage detected