Skip to content

Commit 0217b6c

Browse files
committed
Fixed wrong IPv6 number conversion
1 parent c87192e commit 0217b6c

File tree

4 files changed

+113
-284
lines changed

4 files changed

+113
-284
lines changed

LICENSE.TXT

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2022 IP2Location.com
3+
Copyright (c) 2023 IP2Location.com
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
[![Go Report Card](https://goreportcard.com/badge/github.com/ip2location/ip2proxy-go/v3)](https://goreportcard.com/report/github.com/ip2location/ip2proxy-go/v3)
2-
[![PkgGoDev](https://pkg.go.dev/badge/github.com/ip2location/ip2proxy-go/v3)](https://pkg.go.dev/github.com/ip2location/ip2proxy-go/v3)
1+
[![Go Report Card](https://goreportcard.com/badge/github.com/ip2location/ip2proxy-go/v4)](https://goreportcard.com/report/github.com/ip2location/ip2proxy-go/v4)
2+
[![PkgGoDev](https://pkg.go.dev/badge/github.com/ip2location/ip2proxy-go/v4)](https://pkg.go.dev/github.com/ip2location/ip2proxy-go/v4)
33

44
# IP2Proxy Go Package
55

@@ -18,7 +18,7 @@ To install this module type the following:
1818

1919
```bash
2020

21-
go get github.com/ip2location/ip2proxy-go/v3
21+
go get github.com/ip2location/ip2proxy-go/v4
2222

2323
```
2424

@@ -57,7 +57,8 @@ package main
5757

5858
import (
5959
"fmt"
60-
"github.com/ip2location/ip2proxy-go/v3"
60+
"strconv"
61+
"github.com/ip2location/ip2proxy-go/v4"
6162
)
6263

6364
func main() {
@@ -78,20 +79,19 @@ func main() {
7879
fmt.Printf("PackageVersion: %s\n", db.PackageVersion())
7980
fmt.Printf("DatabaseVersion: %s\n", db.DatabaseVersion())
8081

81-
fmt.Printf("isProxy: %s\n", all["isProxy"])
82-
fmt.Printf("ProxyType: %s\n", all["ProxyType"])
83-
fmt.Printf("CountryShort: %s\n", all["CountryShort"])
84-
fmt.Printf("CountryLong: %s\n", all["CountryLong"])
85-
fmt.Printf("Region: %s\n", all["Region"])
86-
fmt.Printf("City: %s\n", all["City"])
87-
fmt.Printf("ISP: %s\n", all["ISP"])
88-
fmt.Printf("Domain: %s\n", all["Domain"])
89-
fmt.Printf("UsageType: %s\n", all["UsageType"])
90-
fmt.Printf("ASN: %s\n", all["ASN"])
91-
fmt.Printf("AS: %s\n", all["AS"])
92-
fmt.Printf("LastSeen: %s\n", all["LastSeen"])
93-
fmt.Printf("Threat: %s\n", all["Threat"])
94-
fmt.Printf("Provider: %s\n", all["Provider"])
82+
fmt.Printf("IsProxy: %s\n", strconv.Itoa(int(all.IsProxy)));
83+
fmt.Printf("ProxyType: %s\n", all.ProxyType);
84+
fmt.Printf("CountryShort: %s\n", all.CountryShort);
85+
fmt.Printf("CountryLong: %s\n", all.CountryLong);
86+
fmt.Printf("Region: %s\n", all.Region);
87+
fmt.Printf("City: %s\n", all.City);
88+
fmt.Printf("Isp: %s\n", all.Isp);
89+
fmt.Printf("Domain: %s\n", all.Domain);
90+
fmt.Printf("UsageType: %s\n", all.UsageType);
91+
fmt.Printf("Asn: %s\n", all.Asn);
92+
fmt.Printf("As: %s\n", all.As);
93+
fmt.Printf("LastSeen: %s\n", all.LastSeen);
94+
fmt.Printf("Threat: %s\n", all.Threat);
9595

9696
db.Close()
9797
}

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
module github.com/ip2location/ip2proxy-go/v3
1+
module github.com/ip2location/ip2proxy-go/v4
22

33
go 1.14
44

0 commit comments

Comments
 (0)