mirror of https://github.com/mpolden/echoip
Simplify
This commit is contained in:
parent
215cce290c
commit
148451b883
|
@ -31,10 +31,7 @@ func (d *empty) IsEmpty() bool { return true }
|
||||||
func Empty() Database { return &empty{} }
|
func Empty() Database { return &empty{} }
|
||||||
|
|
||||||
func Open(countryDB, cityDB string) (Database, error) {
|
func Open(countryDB, cityDB string) (Database, error) {
|
||||||
var (
|
var country, city *geoip2.Reader
|
||||||
country *geoip2.Reader
|
|
||||||
city *geoip2.Reader
|
|
||||||
)
|
|
||||||
if countryDB != "" {
|
if countryDB != "" {
|
||||||
r, err := geoip2.Open(countryDB)
|
r, err := geoip2.Open(countryDB)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
Loading…
Reference in New Issue