Skip to content

Commit

Permalink
Merge pull request jwilder#193 from testwill/ioutil
Browse files Browse the repository at this point in the history
  • Loading branch information
jwilder authored Jul 9, 2023
2 parents 72405f0 + ce279ea commit f39443c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
5 changes: 2 additions & 3 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import (
"flag"
"fmt"
"io"
"io/ioutil"
"log"
"net"
"net/http"
Expand Down Expand Up @@ -144,12 +143,12 @@ func waitForDependencies() {
} else if err == nil && resp.StatusCode >= 200 && resp.StatusCode < 300 {
log.Printf("Received %d from %s\n", resp.StatusCode, u.String())
// dispose the response body and close it.
io.Copy(ioutil.Discard, resp.Body)
io.Copy(io.Discard, resp.Body)
resp.Body.Close()
return
} else {
log.Printf("Received %d from %s. Sleeping %s\n", resp.StatusCode, u.String(), waitRetryInterval)
io.Copy(ioutil.Discard, resp.Body)
io.Copy(io.Discard, resp.Body)
resp.Body.Close()
time.Sleep(waitRetryInterval)
}
Expand Down
3 changes: 1 addition & 2 deletions template.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package main

import (
"fmt"
"io/ioutil"
"log"
"net/url"
"os"
Expand Down Expand Up @@ -189,7 +188,7 @@ func generateDir(templateDir, destDir string) bool {
}
}

files, err := ioutil.ReadDir(templateDir)
files, err := os.ReadDir(templateDir)
if err != nil {
log.Fatalf("bad directory: %s, error: %s", templateDir, err)
}
Expand Down

0 comments on commit f39443c

Please sign in to comment.