Thanks :) .
On Wednesday, 21 December 2016 15:42:55 UTC+5:30, Axel Wagner wrote:
>
> You need to pass the WaitGroup as a pointer. This way, connectionsCount
> creates a WaitGroup, increments it's counts, passes a copy of it to count
> and then waits on the original; count, however, only Done()s
You need to pass the WaitGroup as a pointer. This way, connectionsCount
creates a WaitGroup, increments it's counts, passes a copy of it to count
and then waits on the original; count, however, only Done()s its copy.
go vet should probably complain about that, as it contains an appropriate
marker
I am trying write a small golang program which will periodically execute lsof
-i: to check number of open TCP connections at a port. Code looks
like below:-
package main
import (
"fmt"
"log"
"os/exec"
"strings"
"sync"
"time"
)
type Lsof struct {
Command string