Support go 1.13
This commit is contained in:
parent
c7805b4bbd
commit
a034e52a6e
3
main.go
3
main.go
|
@ -7,6 +7,7 @@ import (
|
|||
"fmt"
|
||||
"html"
|
||||
"io"
|
||||
"io/ioutil"
|
||||
"mime/multipart"
|
||||
"net/http"
|
||||
"net/url"
|
||||
|
@ -29,7 +30,7 @@ func handleMessage(client *http.Client, botToken string, message *Message) error
|
|||
if len(split) == 2 {
|
||||
command.Stdin = strings.NewReader(split[1])
|
||||
}
|
||||
stdout, err := os.CreateTemp("", "ridi*")
|
||||
stdout, err := ioutil.TempFile("", "ridi*")
|
||||
if err != nil {
|
||||
return fmt.Errorf("failed to create temporary file: %s", err)
|
||||
}
|
||||
|
|
4
utils.go
4
utils.go
|
@ -3,13 +3,13 @@ package main
|
|||
import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"io"
|
||||
"io/ioutil"
|
||||
"net/http"
|
||||
)
|
||||
|
||||
func parseBody(resp *http.Response) (json.RawMessage, error) {
|
||||
defer resp.Body.Close()
|
||||
bytes, err := io.ReadAll(resp.Body)
|
||||
bytes, err := ioutil.ReadAll(resp.Body)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to read response body: %s", err)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue