Skip to content

Commit cc5ebf8

Browse files
committed
Improve Lookup documentation
1 parent acfe9c7 commit cc5ebf8

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

reader.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,8 +104,12 @@ func (r *Reader) startNode() (uint, error) {
104104
return node, err
105105
}
106106

107-
// Lookup takes an IP address as a net.IP structure and a pointer to the
108-
// result value to Decode into.
107+
// Lookup retrieves the database record for ipAddress and stores it in the
108+
// value pointed to be result. If result is nil or not a pointer, an error
109+
// is returned. If the data in the database record cannot be stored in
110+
// result because of type differences, an UnmarshalTypeError is returned.
111+
// If the database is invalid or otherwise cannot be read, an
112+
// InvalidDatabaseError is returned.
109113
func (r *Reader) Lookup(ipAddress net.IP, result interface{}) error {
110114
if r.buffer == nil {
111115
return errors.New("cannot call Lookup on a closed database")

0 commit comments

Comments
 (0)