Ewan Chou 11 years ago
parent
commit
bc56e80fcc
2 changed files with 6 additions and 6 deletions
  1. 4 4
      geoip.go
  2. 2 2
      targeting.go

+ 4 - 4
geoip.go

@@ -18,9 +18,9 @@ type GeoIP struct {
 	cityLastLoad time.Time
 	hasCity      bool
 
-	asn          *geoip.GeoIP
-	hasAsn       bool
-	asnLastLoad  time.Time
+	asn         *geoip.GeoIP
+	hasAsn      bool
+	asnLastLoad time.Time
 }
 
 var geoIP = new(GeoIP)
@@ -65,7 +65,7 @@ func (g *GeoIP) GetCountryRegion(ip net.IP) (country, continent, regionGroup, re
 	return
 }
 
-func (g *GeoIP) GetASN (ip net.IP) (asn string, netmask int) {
+func (g *GeoIP) GetASN(ip net.IP) (asn string, netmask int) {
 	if g.asn == nil {
 		log.Println("No asn database available")
 		return

+ 2 - 2
targeting.go

@@ -32,7 +32,7 @@ func (t TargetOptions) GetTargets(ip net.IP) ([]string, int) {
 	if t&TargetRegion > 0 || t&TargetRegionGroup > 0 {
 		country, continent, regionGroup, region, netmask = geoIP.GetCountryRegion(ip)
 
-	}else if t&TargetCountry > 0 || t&TargetContinent > 0 {
+	} else if t&TargetCountry > 0 || t&TargetContinent > 0 {
 		country, continent, netmask = geoIP.GetCountry(ip)
 	}
 
@@ -40,7 +40,7 @@ func (t TargetOptions) GetTargets(ip net.IP) ([]string, int) {
 		ipStr := ip.String()
 		targets = append(targets, ipStr)
 		dotIndex := strings.LastIndex(ipStr, ".")
-		targets = append(targets, ipStr[:dotIndex] + ".0")
+		targets = append(targets, ipStr[:dotIndex]+".0")
 	}
 
 	if t&TargetASN > 0 && len(asn) > 0 {