diff --git a/README.md b/README.md index 7cc6368..ec623e1 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ A TFTP server that proxies request to an HTTP backend if a file is not found. # How to build - go build tftp.go + go build main.go # How to run ./tftp -url=http://example.com -dir=/var/lib/tftpboot & diff --git a/main.go b/main.go index 9dcf0ab..e351c06 100644 --- a/main.go +++ b/main.go @@ -4,11 +4,11 @@ import ( "flag" "fmt" "io" + "io/ioutil" "net/http" "os" + "path" "time" - "path" - "io/ioutil" "github.com/pin/tftp" ) @@ -50,7 +50,7 @@ func readHandler(filename string, rf io.ReaderFrom) error { defer resp.Body.Close() if resp.StatusCode != 200 { - io.Copy(ioutil.Discard, resp.Body) + io.Copy(ioutil.Discard, resp.Body) return fmt.Errorf("Received status code: %d", resp.StatusCode) }