Hi Santosh,
This is a review of your assignment 2.
-
Nice clean code
-
README is too brief. A user cannot be expected to read the source to figure out the API, how to create the Server etc. In fact, he doesn't even know there is a Server object unless he reads the source. Treat this like a product, not a homework assignment
-
envelopeToMsg does not correctly encode the message because it relies on a string representation of the msg. What if the msg was not a string but a structure with pointers?
type Person struct {x
Name string
Parent *Person
}
parent := &Person{Name: "A", Parent: nil}
person := &Person{Name: "B", Parent: A}
server.Inbox() <- person
-
There are race conditions in your code. Test with go test -race
Hi Santosh,
This is a review of your assignment 2.
Nice clean code
README is too brief. A user cannot be expected to read the source to figure out the API, how to create the Server etc. In fact, he doesn't even know there is a Server object unless he reads the source. Treat this like a product, not a homework assignment
envelopeToMsg does not correctly encode the message because it relies on a string representation of the msg. What if the msg was not a string but a structure with pointers?
There are race conditions in your code. Test with
go test -race