Compare commits
2 Commits
dad789954f
...
6588bd2d45
Author | SHA1 | Date | |
---|---|---|---|
6588bd2d45 | |||
d93c7a6da7 |
14
main.go
14
main.go
@ -10,7 +10,6 @@ import (
|
|||||||
"os"
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
|
||||||
|
|
||||||
"github.com/sethvargo/go-githubactions"
|
"github.com/sethvargo/go-githubactions"
|
||||||
)
|
)
|
||||||
@ -70,6 +69,9 @@ func main() {
|
|||||||
req.Header.Add("Content-Type", mwriter.FormDataContentType())
|
req.Header.Add("Content-Type", mwriter.FormDataContentType())
|
||||||
|
|
||||||
go func() {
|
go func() {
|
||||||
|
defer mwriter.Close()
|
||||||
|
defer writer.Close()
|
||||||
|
|
||||||
err = filepath.Walk(path, func(innerPath string, info fs.FileInfo, err error) error {
|
err = filepath.Walk(path, func(innerPath string, info fs.FileInfo, err error) error {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
@ -103,18 +105,8 @@ func main() {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
githubactions.Fatalf("Unable to create request body: %v", fmt.Errorf("%w", err))
|
githubactions.Fatalf("Unable to create request body: %v", fmt.Errorf("%w", err))
|
||||||
}
|
}
|
||||||
|
|
||||||
if err := mwriter.Close(); err != nil {
|
|
||||||
githubactions.Fatalf("Unable to close multipart writer: %v", fmt.Errorf("%w", err))
|
|
||||||
}
|
|
||||||
|
|
||||||
if err := writer.Close(); err != nil {
|
|
||||||
githubactions.Fatalf("Unable to close writer: %v", fmt.Errorf("%w", err))
|
|
||||||
}
|
|
||||||
}()
|
}()
|
||||||
|
|
||||||
time.Sleep(10 * time.Second)
|
|
||||||
|
|
||||||
githubactions.Infof("Calling node API")
|
githubactions.Infof("Calling node API")
|
||||||
client := &http.Client{}
|
client := &http.Client{}
|
||||||
res, err := client.Do(req)
|
res, err := client.Do(req)
|
||||||
|
Loading…
Reference in New Issue
Block a user