March 6, 2013

Peer-to-Peer Command-Line Chat in Go Lang

I just implemented a peer to peer (p2p) command-line chat in Go language version as an example to start with. I start to like Go!

You can view the source code here on Github: https://github.com/mshahriarinia/Golang/blob/master/p2pChat/src/node.go

Some notes :

1. Spent quite some time on finding and setting up debuggers
for Go language but could not find one or the setup was not straight forward therefore I just proceeded without a debugger.

2. Finding a simple basic example of how to read arbitrary strings from standard input (command-line) was not available to my surprise. and this basic issue took a while to figure out how to do it (with buffers and OS package and some other related packages)

3. Go offers the concept of channels but I realized that in this context it is not providing the best solution

4. Pointers, pass by value, pass by reference, structs were not straightforward initially and there was no single place explaining these issues, so I had to hack through and settle the issue.

No comments:

Post a Comment