Skip to content

Commit 4424686

Browse files
committed
Fix Export/Import comments
Some vestiges from the Gob implementation
1 parent afae4c4 commit 4424686

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

encode.go

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,7 @@ const encodingVersion = 1
112112

113113
// Export writes the graph to a writer.
114114
//
115-
// T must be encodable by encoding/binary or implement io.WriterTo.
116-
// The underlying value type must be encodable with Gob.
115+
// T must implement io.WriterTo.
117116
func (h *Graph[T]) Export(w io.Writer) error {
118117
distFuncName, ok := distanceFuncToName(h.Distance)
119118
if !ok {
@@ -162,9 +161,9 @@ func (h *Graph[T]) Export(w io.Writer) error {
162161
}
163162

164163
// Import reads the graph from a reader.
165-
// T must be decodable by encoding/binary or implement io.ReaderFrom.
166-
// The parameters do not have to be equal to the parameters
167-
// of the exported graph. The graph will converge onto the new parameters.
164+
// T must implement io.ReaderFrom.
165+
// The imported graph does not have to match the exported graph's parameters (except for
166+
// dimensionality). The graph will converge onto the new parameters.
168167
func (h *Graph[T]) Import(r io.Reader) error {
169168
var (
170169
version int

0 commit comments

Comments
 (0)