From 9d9bc4b155d1210a02d2a6da5725ee0699588487 Mon Sep 17 00:00:00 2001 From: Cuong Manh Le Date: Thu, 7 Nov 2019 12:20:13 +0700 Subject: [PATCH] cmd,js: remove un-necessary type conversion --- cmd/convert_test.go | 2 +- js/initcontext_test.go | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/cmd/convert_test.go b/cmd/convert_test.go index cee59788213..98d54c401e8 100644 --- a/cmd/convert_test.go +++ b/cmd/convert_test.go @@ -138,7 +138,7 @@ func TestIntegrationConvertCmd(t *testing.T) { defaultFs = afero.NewMemMapFs() - err = afero.WriteFile(defaultFs, harFile, []byte(har), 0644) + err = afero.WriteFile(defaultFs, harFile, har, 0644) assert.NoError(t, err) buf := &bytes.Buffer{} diff --git a/js/initcontext_test.go b/js/initcontext_test.go index 0b5ca524938..0fe963f4cc4 100644 --- a/js/initcontext_test.go +++ b/js/initcontext_test.go @@ -238,9 +238,8 @@ func TestInitContextRequire(t *testing.T) { func createAndReadFile(t *testing.T, file string, content []byte, expectedLength int, binary bool) (*BundleInstance, error) { fs := afero.NewMemMapFs() assert.NoError(t, fs.MkdirAll("/path/to", 0755)) - assert.NoError(t, afero.WriteFile(fs, "/path/to/"+file, []byte(content), 0644)) + assert.NoError(t, afero.WriteFile(fs, "/path/to/"+file, content, 0644)) - afero.WriteFile(fs, "/path/to/"+file, []byte(content), 0644) binaryArg := "" if binary { binaryArg = ",\"b\""