Skip to content

Commit

Permalink
Use fmt for traces
Browse files Browse the repository at this point in the history
  • Loading branch information
ofaurax committed Nov 9, 2023
1 parent 8ffb2dd commit e2b7e64
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions providers/asrockrack/helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -233,40 +233,40 @@ func (a *ASRockRack) uploadFirmware(ctx context.Context, endpoint string, fwRead
// initiate a mulitpart writer
form := multipart.NewWriter(pipeWriter)

a.log.V(2).Info("Launching go routine")
fmt.Println("Launching go routine")

errCh := make(chan error, 1)
go func() {
defer pipeWriter.Close()

a.log.V(2).Info("CreateFormFile")
fmt.Println("CreateFormFile")
// create form part
part, err := form.CreateFormFile(fieldName, fileName)
if err != nil {
errCh <- err
return
}

a.log.V(2).Info("Copy from reader")
fmt.Println("Copy from reader")
// copy from source into form part writer
_, err = io.Copy(part, fwReader)
if err != nil {
errCh <- err
return
}

a.log.V(2).Info("Before Close")
fmt.Println("Before Close")
// add terminating boundary to multipart form
errCh <- form.Close()
a.log.V(2).Info("After Close")
fmt.Println("After Close")
}()

// multi-part content type
headers := map[string]string{
"Content-Type": form.FormDataContentType(),
}

a.log.V(2).Info("After headers")
fmt.Println("After headers")
//<-errCh

//mybytes, err := io.ReadAll(pipeReader)
Expand Down

0 comments on commit e2b7e64

Please sign in to comment.