simplify slice expressions: s[:] => s (#1541)
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Found using https://go-critic.github.io/overview#unslice-ref
authored by Iskander (Alex) Sharipov · committed by Bo-Yi Wu · parent df1e17c · Browse files · 3 files·+12 added−12 removed
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Diff stats
3 files+12 added−12 removed
- other:+12 added−12 removed
Provenance
- Commit
3f27866- Tree
4f28553- Author
Iskander (Alex) Sharipov <iskander.sharipov@intel.com>- Committer
Bo-Yi Wu <appleboy.tw@gmail.com>- Parent
df1e17c
3 files changed+12 added−12 removed
modified:render/render_test.go+1 added-1 removed
285 unmodified lines286 287 err = (ProtoBuf{data}).Render(w)288 289 assert.NoError(t, err)290- assert.Equal(t, string(protoData[:]), w.Body.String())290+ assert.Equal(t, string(protoData), w.Body.String())291 assert.Equal(t, "application/x-protobuf", w.Header().Get("Content-Type"))292 }293 294 func TestRenderProtoBufFail(t *testing.T) {192 unmodified linesmodified:context_test.go+1 added-1 removed
976 unmodified lines977 protoData, err := proto.Marshal(data)978 assert.NoError(t, err)979 980 assert.Equal(t, http.StatusCreated, w.Code)981- assert.Equal(t, string(protoData[:]), w.Body.String())981+ assert.Equal(t, string(protoData), w.Body.String())982 assert.Equal(t, "application/x-protobuf", w.HeaderMap.Get("Content-Type"))983 }984 985 func TestContextHeaders(t *testing.T) {703 unmodified linesmodified:gin_test.go+10 added-10 removed
86 unmodified lines87 fmt.Println(err)88 }89 90 resp, _ := ioutil.ReadAll(res.Body)91- assert.Equal(t, "<h1>Hello world</h1>", string(resp[:]))91+ assert.Equal(t, "<h1>Hello world</h1>", string(resp))92 93 td()94 }95 4 unmodified lines100 fmt.Println(err)101 }102 103 resp, _ := ioutil.ReadAll(res.Body)104- assert.Equal(t, "<h1>Hello world</h1>", string(resp[:]))104+ assert.Equal(t, "<h1>Hello world</h1>", string(resp))105 106 td()107 }108 4 unmodified lines113 fmt.Println(err)114 }115 116 resp, _ := ioutil.ReadAll(res.Body)117- assert.Equal(t, "<h1>Hello world</h1>", string(resp[:]))117+ assert.Equal(t, "<h1>Hello world</h1>", string(resp))118 119 td()120 }121 11 unmodified lines133 fmt.Println(err)134 }135 136 resp, _ := ioutil.ReadAll(res.Body)137- assert.Equal(t, "<h1>Hello world</h1>", string(resp[:]))137+ assert.Equal(t, "<h1>Hello world</h1>", string(resp))138 139 td()140 }141 5 unmodified lines147 fmt.Println(err)148 }149 150 resp, _ := ioutil.ReadAll(res.Body)151- assert.Equal(t, "Date: 2017/07/01\n", string(resp[:]))151+ assert.Equal(t, "Date: 2017/07/01\n", string(resp))152 153 td()154 }155 30 unmodified lines186 fmt.Println(err)187 }188 189 resp, _ := ioutil.ReadAll(res.Body)190- assert.Equal(t, "<h1>Hello world</h1>", string(resp[:]))190+ assert.Equal(t, "<h1>Hello world</h1>", string(resp))191 td()192 }193 194 func TestLoadHTMLFiles2(t *testing.T) {3 unmodified lines198 fmt.Println(err)199 }200 201 resp, _ := ioutil.ReadAll(res.Body)202- assert.Equal(t, "<h1>Hello world</h1>", string(resp[:]))202+ assert.Equal(t, "<h1>Hello world</h1>", string(resp))203 td()204 }205 206 func TestLoadHTMLFiles3(t *testing.T) {3 unmodified lines210 fmt.Println(err)211 }212 213 resp, _ := ioutil.ReadAll(res.Body)214- assert.Equal(t, "<h1>Hello world</h1>", string(resp[:]))214+ assert.Equal(t, "<h1>Hello world</h1>", string(resp))215 td()216 }217 218 func TestLoadHTMLFilesUsingTLS(t *testing.T) {10 unmodified lines229 fmt.Println(err)230 }231 232 resp, _ := ioutil.ReadAll(res.Body)233- assert.Equal(t, "<h1>Hello world</h1>", string(resp[:]))233+ assert.Equal(t, "<h1>Hello world</h1>", string(resp))234 td()235 }236 237 func TestLoadHTMLFilesFuncMap(t *testing.T) {4 unmodified lines242 fmt.Println(err)243 }244 245 resp, _ := ioutil.ReadAll(res.Body)246- assert.Equal(t, "Date: 2017/07/01\n", string(resp[:]))246+ assert.Equal(t, "Date: 2017/07/01\n", string(resp))247 248 td()249 }250 207 unmodified lines