Skip to content

*Reader.City returns the zero value if not found #32

Open
@celrenheit

Description

@celrenheit

Hello,

The methods City() and Country should return nil if it finds nothing.

The current behavior is that is returns the zero value: https://github.com/oschwald/geoip2-golang/blob/master/reader.go#L240.

In this case, we have to check if city.GeonameID == 0 to know that it is not found.

Wouldn't it be better to return nil instead ?

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions