fix linter issues (#329)

* fix linter issues
* replace fmt with logger
Signed-off-by: Fabian Kammel <fk@edgeless.systems>
Co-authored-by: Daniel Weiße <66256922+daniel-weisse@users.noreply.github.com>
This commit is contained in:
Fabian Kammel 2022-08-02 16:25:47 +02:00 committed by GitHub
parent 1859dc1718
commit 985585f578
8 changed files with 41 additions and 16 deletions

View file

@ -1,6 +1,7 @@
package qemu
import (
"context"
"net/http"
"net/url"
"strings"
@ -23,7 +24,12 @@ func (l *Logger) Disclose(msg string) {
Path: "/log",
}
_, _ = http.Post(url.String(), "application/json", strings.NewReader(msg))
req, _ := http.NewRequestWithContext(context.Background(), http.MethodPost, url.String(), strings.NewReader(msg))
req.Header.Set("Content-Type", "application/json")
resp, err := http.DefaultClient.Do(req)
if err == nil {
defer resp.Body.Close()
}
}
// Close is a no-op.