MCPcopy
hub / github.com/OJ/gobuster / progressWorker

Function progressWorker

cli/gobuster.go:111–127  ·  view source on GitHub ↗

progressWorker outputs the progress every tick. It will stop once cancel() is called on the context

(ctx context.Context, g *libgobuster.Gobuster, wg *sync.WaitGroup)

Source from the content-addressed store, hash-verified

109// progressWorker outputs the progress every tick. It will stop once cancel() is called
110// on the context
111func progressWorker(ctx context.Context, g *libgobuster.Gobuster, wg *sync.WaitGroup) {
112 defer wg.Done()
113
114 tick := time.NewTicker(cliProgressUpdate)
115
116 for {
117 select {
118 case <-tick.C:
119 printProgress(g)
120 case <-ctx.Done():
121 // print the final progress so we end at 100%
122 printProgress(g)
123 fmt.Println() // nolint:forbidigo
124 return
125 }
126 }
127}
128
129func writeToFile(f *os.File, output string) error {
130 _, err := fmt.Fprintf(f, "%s\n", output)

Callers 1

GobusterFunction · 0.85

Calls 2

printProgressFunction · 0.85
PrintlnMethod · 0.80

Tested by

no test coverage detected