gonum / hdf5

hdf5 is a wrapper for the HDF5 library
BSD 3-Clause "New" or "Revised" License
131 stars 33 forks source link

hdf5/h5a: consider dropping the Datatype arg in Attribute.Read/Write #67

Open sbinet opened 4 years ago

sbinet commented 4 years ago

right now we have this API for Attribute:

type Attribute struct {
        Identifier
}

// Read reads raw data from a attribute into a buffer.
func (s *Attribute) Read(data interface{}, dtype *Datatype) error { ... }

// Write writes raw data from a buffer to an attribute.
func (s *Attribute) Write(data interface{}, dtype *Datatype) error { ... }

we already use reflect for the interface{} part (to discover its underlying type) so the *Datatype is not strictly needed in Go. (even in the not (yet?) handled case of conversions).