From 52811552c6e31491cb96bc2f7356901f64bd9e43 Mon Sep 17 00:00:00 2001 From: Bruce Date: Wed, 19 Sep 2018 15:47:46 +0800 Subject: [PATCH] test http post --- playground/http/upload_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/playground/http/upload_test.go b/playground/http/upload_test.go index 4338e04..180c032 100644 --- a/playground/http/upload_test.go +++ b/playground/http/upload_test.go @@ -26,11 +26,11 @@ func TestUploadFormFile(t *testing.T) { body := new(bytes.Buffer) //body := &bytes.Buffer{} writer := multipart.NewWriter(body) - formFile, err := writer.CreateFormFile("file", filepath.Base(filePath)) + formFileWriter, err := writer.CreateFormFile("file", filepath.Base(filePath)) if err != nil { t.Fatal(err) } - if _, err = io.Copy(formFile, bytes.NewReader(yamlFile)); err != nil { + if _, err = io.Copy(formFileWriter, bytes.NewReader(yamlFile)); err != nil { t.Fatal(err) } writer.Close()