Marcel Lanz (6) [Avatar] Offline
#1
Hi

Thank you for this great book. I've read V2 and just checked my comments against V3 and here they are. Some are just my opinion and perhaps too picky.
hope it helps.

Marcel

Go_in_Action_v3_MEAP
PDF

p6:
logging happens concurrently
> logging concurrently ist a great idea, but it has to be done right. waiting to be sure the disk or receiver of a log message get "fsynced" if crucial in error cases. I tried to log via goroutines in one of my first applications, and there was the error case, where the app near a log statement crashed and the "concurrent" logger was not able to write the debug log before the application terminated.

p8:
Go developers simply embed types to re-use functionality in a design pattern called Composition.
> loose coupling seems to be also a valid advantage

p8:
But rather than building a long inheritance structure
> to be fair, most JAVA frameworks and common JAVA use don't recommend long/deep inheritance

see also EffectiveJava =>
Item 18: Prefer interfaces to abstract classes
Item16 : Favor composition over inheritance

p9:
You're often required to think through a large inheritance chain before you're able to even start writing code
> which is not true for most modern libraries and frameworks, see above.

p11:
Hello World
> go fmt ?

p11:
Fire up a web browser and navigate to http://play.golang.org We'll wait for you.
> does that sound not strange.

p11:
Click the RUN button and see what happens!
> the button is named: Run not RUN

p12:
Go ahead and change the greeting inside the fmt.Println() function and hit RUN again.
> the button is named: Run not RUN

p21:
They contain a unique value which is always an address.
> why are they unique

p22:
Pointer variables pointing to variables of the proper type
> why not using HEX formatting?

p40:
2.4 Uncommon Features Of Functions
> I found the method call on nil receiver "uncommon" too.
example:
http://play.golang.org/p/PLo3WP54zg

p40, p41, p42:
query := bson.M{"user": user"}

> this should be (I think):
query := bson.M{"user": user}

p50:
func main(){
> go fmt. space between main() and {

p55:
3.3 Init
> actually one can define multiple init() functions in the same package
see: http://play.golang.org/p/FgsCzqkCrH
spec: Multiple such functions may be defined, even within a single source file; they execute in unspecified order.
Bill Kennedy (69) [Avatar] Offline
#2
Re: Comments on Go_in_Action_v3_MEAP.pdf: Chapter 1-3
Thanks for the quick review. I have a couple of changes to make smilie

--------------------------------------------------------------------------------------

p21:
They contain a unique value which is always an address.
> why are they unique
>> Good question

--------------------------------------------------------------------------------------

p22:
Pointer variables pointing to variables of the proper type
> why not using HEX formatting?
>> Don't understand your question

--------------------------------------------------------------------------------------

p40:
2.4 Uncommon Features Of Functions
> I found the method call on nil receiver "uncommon" too.
example:
http://play.golang.org/p/PLo3WP54zg
>> That is cool. Let me ask the others about including this.

--------------------------------------------------------------------------------------

p40, p41, p42:
query := bson.M{"user": user"}
> this should be (I think):
query := bson.M{"user": user}
>> Great Catch

--------------------------------------------------------------------------------------

p50:
func main(){
> go fmt. space between main() and {
>> It is not idiomatic to have a space as the first line in a function.
Marcel Lanz (6) [Avatar] Offline
#3
Re: Comments on Go_in_Action_v3_MEAP.pdf: Chapter 1-3
p22:
Pointer variables pointing to variables of the proper type
> why not using HEX formatting?
>> Don't understand your question
>>> I meant 0x001D instead of 001D

p50:
func main(){
> go fmt. space between main() and {
>> It is not idiomatic to have a space as the first line in a function.
>>> no I meant the missing space between () and {.
>>> so instead of "main(){" => "main {" this is what go fmt would reformatt it.
Bill Kennedy (69) [Avatar] Offline
#4
Re: Comments on Go_in_Action_v3_MEAP.pdf: Chapter 1-3
Got It. We are throwing out chapter 2 and going to rewrite it based on this example:

https://github.com/goinaction/code/tree/master/src/chapter2/search

Please check it out if you like.