Skip to content

Conversation

@dszczyt
Copy link

@dszczyt dszczyt commented Jul 19, 2017

No description provided.

Copy link
Owner

@abh abh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add a test or two, also?

geoip.go Outdated

cdbinfo := C.GeoIP_database_info(gi.db)
if cdbinfo != nil {
databaseInfos = C.GoString(cdbinfo)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

doesn't this also need

defer C.free(unsafe.Pointer(cdbinfo))

?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's an unexpected destroy in my copy/paste... Fixing...

geoip.go Outdated
return
}

func (gi *GeoIP) GetDatabaseInfo() (databaseInfos string) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was going to complain about the named return variable, but it looks like I was doing that elsewhere here too. :-)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just copied/pasted one of your methods, but I prefer the unnamed return version

@dszczyt
Copy link
Author

dszczyt commented Jul 20, 2017

OK for the tests, but the test-db files don't provided these database informations. So checking with empty string would not be an appropriate test

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants