File tree Expand file tree Collapse file tree 1 file changed +3
-14
lines changed
Expand file tree Collapse file tree 1 file changed +3
-14
lines changed Original file line number Diff line number Diff line change 11package main
22
33import (
4- "bufio"
5- "fmt"
4+ "flag"
65 "iamargus95/fetchGithubData/githubapi"
76 "iamargus95/fetchGithubData/io"
8- "os"
97 "strings"
108 "sync"
119)
1210
1311func main () {
14-
15- usernames := getUsername ()
12+ flag . Parse ()
13+ usernames := flag . Args ()
1614
1715 var wg sync.WaitGroup
1816 dataToFile := make (chan []string )
@@ -26,15 +24,6 @@ func main() {
2624 wg .Wait ()
2725}
2826
29- func getUsername () []string {
30- fmt .Println ("\n Enter the desired GitHub usernames separated by a space and press enter : " )
31- reader := bufio .NewReader (os .Stdin )
32- input , _ := reader .ReadString ('\n' )
33- input = strings .TrimSuffix (input , "\n " )
34- argString := strings .Split (input , " " )
35- return argString
36- }
37-
3827func worker (username string , dataToFile chan []string , wg * sync.WaitGroup ) {
3928
4029 defer wg .Done ()
You can’t perform that action at this time.
0 commit comments