Closed kennykarnama closed 1 year ago
I just want to understand, why in Host struct, Port is in int type not in string ?
Host
Port
int
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
net.SplitHostPort
Also, for the reference: https://stackoverflow.com/questions/47992477/why-is-port-a-string-and-not-an-integer
That's to mimic our other clients. You can use the NewHosts(...string) utility function for a shortcut if you prefer.
NewHosts(...string)
Okay, understood. Thank you for your answer.
Question
I just want to understand, why in
Host
struct,Port
is inint
type not instring
?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#L119Also, for the reference: https://stackoverflow.com/questions/47992477/why-is-port-a-string-and-not-an-integer