Skip to content

Commit

Permalink
better geo output when no LICENSE key
Browse files Browse the repository at this point in the history
  • Loading branch information
Jozef Reisinger committed Oct 29, 2021
1 parent 930dddb commit 1d3a221
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions geo.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,11 @@ func (g *Geo) Check(ip net.IP) error {
g.Country = record.Country.Names["en"]
g.IsoCode = record.Country.IsoCode

return nil
}

// Info returns interesting information from the check.
func (g *Geo) Info() string {
if g.City == "" {
g.City = "city unknown"
}
Expand All @@ -51,10 +56,5 @@ func (g *Geo) Check(ip net.IP) error {
if g.IsoCode == "" {
g.IsoCode = "ISO code unknown"
}
return nil
}

// Info returns interesting information from the check.
func (g *Geo) Info() string {
return fmt.Sprintf("Geolocation\t%s, %s (%s)", g.City, g.Country, g.IsoCode)
}

0 comments on commit 1d3a221

Please sign in to comment.