nicolasdilley / Gomela

Tool developped for "Bounded verification of message passing concurrency in Go programs."
39 stars 7 forks source link

Add support for field struct that have waitgroup as a type #1

Closed nicolasdilley closed 4 years ago

nicolasdilley commented 4 years ago

In this example the WaitGroup t.wg is declared automatically because the default value of a sync.WaitGroup is an empty WaitGroup not nil

type T struct { wg sync.Waitgroup }

func main () { t := T{} t.wg.Add(10)

for i := 0; i < 10; i ++ { go func(){ // Do some work t.wg.Done() } }

t.wg.Wait() }