In addition to the god points that others have made, there is a difference
in the way that memory will be allocated. See
https://play.golang.org/p/l6d4lODiDx and pay attention to the "delta"
lines. In this particular example, using a map to a pointer does a Malloc
for every map item, whereas
Yes, your tests should have the the *same *package name as your code, so in
this case *package pybr*. They will not effect the package when built
normally. They are only included when running *go test*. You also need to
name your tests correctly, and they need a signature like:
func
While there may be better ways to express what this logic, for clarity,
here is the change that golint is actually suggesting:
// Load returns the list of partition found and their properties.
func (l *LinuxLoader) Load() ([]*Properties, error) {
//-
ret := []*Properties{}
if temp,
On Wednesday, March 8, 2017 at 9:50:09 AM UTC-5, Chris Hines wrote:
>
> The infinite loops in each function will busy loop and consume a core
> without allowing the runtime scheduler a chance to run other goroutines on
> that core. If your virtual machine doesn't have enough cores then some
>
On Sunday, February 19, 2017 at 3:41:13 AM UTC-5, Marwan abdel moneim wrote:
>
> i wanted to do it without a Mutex
> but there still something not clear to me, but i don't know what it is
> and i don't understand what "trigger" synchronization means
>
> i will keep reading, and go back to it
should mention that what you want can be achieved with composition using
anonymous fields:
https://play.golang.org/p/vEKS70A-29
I know its not your original question, and this only works with `strcut`
and `interface`, not build in types, like `int`. But it does give you the
kind of behavior