cmd icon indicating copy to clipboard operation
cmd copied to clipboard

Why status.Stdout is empty in my code

Open wejoy opened this issue 4 years ago • 2 comments

func main() {
	findCmd := cmd.NewCmd("dir")
	statusChan := findCmd.Start()
	go func() {
		for {
			fmt.Println("-------")
			status := findCmd.Status()
			fmt.Println(status.Stdout)
		}
	}()
	<-statusChan
	fmt.Println("=======")
}

I run this program on Win10, and get something like that:

-------
[]
-------
[]
-------
[]
-------
[]
-------
[]
-------
[]
-------
[]

So, what's the problem of it.

wejoy avatar Jan 26 '21 06:01 wejoy

OK, I find the problem, command "dir" is not work, but "go env" get outputs, I haven't watched or tested inner code, but I think it maybe is a problem.

wejoy avatar Jan 26 '21 06:01 wejoy

also cant get dir to work, guessing module is a bit borked?

0xRoM avatar Oct 03 '21 05:10 0xRoM