Hi guys, I trying to write a directory enumerater in Golang with net/http, os, bufio and fmt, I’m a newbie of golang because I study this language from few time, the code is this:
$ go vet main.go
./main.go:23:22: Sprint call has possible formatting directive %s
$
Sprint
req,err1:=http.Get(fmt.Sprint("%s/%s",os.Args[1],scanner.Text()))
should be Sprintf
req,err1:=http.Get(fmt.Sprintf("%s/%s",os.Args[1],scanner.Text()))
Also, handle errors. For example,
req,err1:=http.Get(fmt.Sprintf("%s/%s",os.Args[1],scanner.Text()))
if err1 != nil {
// handle error
continue
}