You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If a Go program uses this package and will be build using go install ./... it can't build because
of an type error in geoip-demo.go:
# github.com/abh/geoip/ex
src/github.com/abh/geoip/ex/geoip-demo.go:41:9: cannot use *gi (type geoip.GeoIP) as type *geoip.GeoIP in argument to test4
src/github.com/abh/geoip/ex/geoip-demo.go:42:9: cannot use *gi (type geoip.GeoIP) as type *geoip.GeoIP in argument to test4
This is caused by a wrong type in geoip-demo.go. geoip.Open returns a pointer to GeoIP structure and the function test4 in the geoip-demo.go file expects a pointer but the main function passes the structure instead of the pointer.
This patch will fix this issue:
--- ex/geoip-demo.go.original 2020-06-06 11:24:57.841432573 +0200+++ ex/geoip-demo.go 2020-06-06 11:25:04.749461347 +0200@@ -38,8 +38,8 @@
}
if gi != nil {
- test4(*gi, "207.171.7.51")- test4(*gi, "127.0.0.1")+ test4(gi, "207.171.7.51")+ test4(gi, "127.0.0.1")
}
if gi6 != nil {
ip := "2607:f238:2::5"
The text was updated successfully, but these errors were encountered:
If a Go program uses this package and will be build using
go install ./...
it can't build becauseof an type error in
geoip-demo.go
:This is caused by a wrong type in
geoip-demo.go
.geoip.Open
returns a pointer toGeoIP
structure and the functiontest4
in thegeoip-demo.go
file expects a pointer but themain
function passes the structure instead of the pointer.This patch will fix this issue:
The text was updated successfully, but these errors were encountered: