@@ -5,20 +5,23 @@ import (
5
5
"runtime"
6
6
"sort"
7
7
8
- "github/mytechnotalent/turbo-scanner/routine"
8
+ "github.com/mytechnotalent/turbo-scanner/routine"
9
+ "github.com/mytechnotalent/turbo-scanner/services"
10
+ "github.com/mytechnotalent/turbo-scanner/setup"
9
11
)
10
12
11
13
func main () {
12
14
if runtime .GOOS == "linux" {
13
- linuxSetup ()
15
+ setup . LinuxSetup ()
14
16
}
15
17
18
+ var host string
16
19
ports := make (chan int , 1000 )
17
20
results := make (chan int )
18
21
var openports []int
19
22
20
23
for i := 0 ; i < cap (ports ); i ++ {
21
- go routine .Routine (ports , results )
24
+ go routine .Routine (& host , ports , results )
22
25
}
23
26
24
27
go func () {
@@ -40,11 +43,11 @@ func main() {
40
43
for _ , port := range openports {
41
44
fmt .Printf ("%d open\n " , port )
42
45
if runtime .GOOS == "windows" {
43
- fmt .Println (winService (& port ))
46
+ fmt .Println (services . WinService (& port ))
44
47
} else if runtime .GOOS == "darwin" {
45
- fmt .Println (macService (& port ))
48
+ fmt .Println (services . MacService (& port ))
46
49
} else if runtime .GOOS == "linux" {
47
- fmt .Println (linuxService (& port ))
50
+ fmt .Println (services . LinuxService (& port ))
48
51
}
49
52
}
50
53
0 commit comments