Golang : dial tcp: too many colons in address
Encounter this error message Golang : dial tcp: too many colons in address ssl://smtp.googlemail.com:465
while working on the transaction email portion today.
After some debugging, found out that Go doesn't like anything more than 1 colon in a string for hostname and password
To fix the problem, just close the string with brackets.
from
smtpHost := "ssl://smtp.googlemail.com"
to
smtpHost := "[ssl://smtp.googlemail.com]"
Basically, when dealing with hostname, password, and dial function. The rule of thumb is
[user:pass@hostname]:portnum
By Adam Ng
IF you gain some knowledge or the information here solved your programming problem. Please consider donating to the less fortunate or some charities that you like. Apart from donation, planting trees, volunteering or reducing your carbon footprint will be great too.
Advertisement
Tutorials
+6.8k Golang : Experimental emojis or emoticons icons programming language
+20.8k Android Studio : AlertDialog and EditText to get user string input example
+7.2k Golang : Transform lisp or spinal case to Pascal case example
+7.3k Golang : Dealing with postal or zip code example
+9.4k Golang : How to get ECDSA curve and parameters data?
+6.4k PHP : Proper way to get UTF-8 character or string length
+11.4k Golang : Characters limiter example
+10.3k Golang : Bcrypting password
+10.2k Golang : Check a web page existence with HEAD request example
+20.1k Golang : Convert(cast) bytes.Buffer or bytes.NewBuffer type to io.Reader
+10.9k Golang : Sieve of Eratosthenes algorithm