aerospike / aerospike-client-go

Aerospike Client Go
Apache License 2.0
429 stars 199 forks source link

Field Port in type Host is Int #390

Closed kennykarnama closed 1 year ago

kennykarnama commented 1 year ago

Question

I just want to understand, why in Host struct, Port is in int type not in string ?

Because I check you use net.SplitHostPort that returns a string and then you need to convert it back and you convert it again to string in here: https://github.com/aerospike/aerospike-client-go/blob/master/connection.go#L119

Also, for the reference: https://stackoverflow.com/questions/47992477/why-is-port-a-string-and-not-an-integer

khaf commented 1 year ago

That's to mimic our other clients. You can use the NewHosts(...string) utility function for a shortcut if you prefer.

kennykarnama commented 1 year ago

Okay, understood. Thank you for your answer.