I was going through an example of a TCP server. They defined a function and called it with:
go handleRequest(conn)
I thought it was weird seeing the go
keyword, so I tried it without:
handleRequest(conn)
To my surprise, this worked!
- If both work the same way, why use the
go
keyword at all? - If they work differently, what is the difference?
- Is there a certain style guideline to use, or should you just use personal preference?