chore(): Migrates from the deprecated ioutil #2
1 changed files with 2 additions and 3 deletions
5
main.go
5
main.go
|
@ -3,7 +3,6 @@ package main
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
"io/ioutil"
|
|
||||||
"log"
|
"log"
|
||||||
"net/http"
|
"net/http"
|
||||||
"os"
|
"os"
|
||||||
|
@ -15,7 +14,7 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
// VERSION The version release
|
// VERSION The version release
|
||||||
const VERSION = "0.1.4"
|
const VERSION = "0.1.5"
|
||||||
|
|
||||||
// AUTHOR The author name
|
// AUTHOR The author name
|
||||||
const AUTHOR = "Elia el Lazkani"
|
const AUTHOR = "Elia el Lazkani"
|
||||||
|
@ -72,7 +71,7 @@ func (w weather) get(req *http.Request, download bool) {
|
||||||
|
|
||||||
// `weather` method to print the weather
|
// `weather` method to print the weather
|
||||||
func (w weather) print(resp *http.Response) {
|
func (w weather) print(resp *http.Response) {
|
||||||
body, err := ioutil.ReadAll(resp.Body)
|
body, err := io.ReadAll(resp.Body)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatal("Error reading body. ", err)
|
log.Fatal("Error reading body. ", err)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue