Yu-Lang Chu[Go] Speed up writing table-driven test with GoLandGoLand provides a lot of feature to increase Gopher’s productivity.Sep 29, 2019Sep 29, 2019
Yu-Lang Chu[Go] Named return with defer..Named return and defer both are very useful in golang. They make code simple and short, bring more convenience. But if put together, may…Sep 18, 2019Sep 18, 2019
Yu-Lang Chu[Go] Stack or heap(4): improving heap performance with sync.PoolKeeping all memory allocation on the stack will have best performance, but unfortunately it’s unavoidable to use memory allocated on the…Aug 14, 2019Aug 14, 2019
Yu-Lang Chu[Go] Stack or heap(3): non-inline struct could cause escape to heapIn previous articles, we see example of slice. Struct has similar behavior like slice, but initializing struct with inline field or not…Jul 10, 2019Jul 10, 2019
Yu-Lang Chu[Go] Stack or heap(2): slices which keep in stack have limitation of sizeVariables in stack must have limit, otherwise stack overflow will happen often. Go compiler will choose heap or stack for slice not only…Jul 4, 20191Jul 4, 20191
Yu-Lang Chu[Go] Stack or heap(1): does it matter?In golang language specification, you can’t find any description about stack or heap. But some information you can find in golang FAQ .Jun 27, 2019Jun 27, 2019
Yu-Lang Chu[Go] Function as arguments or returned value: Some use casesreturn “tear down” or “close” functionJun 11, 2019Jun 11, 2019
Yu-Lang Chu[Go] Function in Strategy patternIn previous story , we have seen some example for function in decorator pattern and HandleFunc. In this story, we try to refactor typical…May 31, 2019May 31, 2019
Yu-Lang Chu[Go] function decorator in http.HandleFuncFunctions in golang is one of first class citizens. It means function is very powerful and flexible. We could assign functions to variable…May 17, 2019May 17, 2019
Yu-Lang ChuGolang: a bidirectional channel is a one-direction channel, but an array of bidirectional channels…When I added channel direction to fan-out pattern code, found something weird.May 6, 2019May 6, 2019