gin icon indicating copy to clipboard operation
gin copied to clipboard

Convert strings and slices using the officially recommended way

Open hopehook opened this issue 3 years ago • 4 comments

Go official is expected to provide unsafe.{SliceData, Slice, StringData, String} series methods in version 1.20 for conversion of strings and slices.

Reference: https://github.com/golang/go/issues/53003

hopehook avatar Oct 01 '22 13:10 hopehook

This change needs to wait for the release of go1.20, please review it at that time, thank you.

hopehook avatar Oct 01 '22 13:10 hopehook

Please add a reference documentation link.

appleboy avatar Oct 16 '22 01:10 appleboy

please rebase the master branch.

appleboy avatar Oct 16 '22 01:10 appleboy

Codecov Report

Merging #3344 (76a8ac8) into master (33ab0fc) will increase coverage by 0.36%. The diff coverage is n/a.

@@            Coverage Diff             @@
##           master    #3344      +/-   ##
==========================================
+ Coverage   98.27%   98.63%   +0.36%     
==========================================
  Files          42       42              
  Lines        3127     3151      +24     
==========================================
+ Hits         3073     3108      +35     
+ Misses         40       29      -11     
  Partials       14       14              
Flag Coverage Δ
98.63% <ø> (+0.36%) :arrow_up:
go-1.17 ?
go-1.18 98.54% <ø> (+0.36%) :arrow_up:
go-1.19 98.63% <ø> (+0.36%) :arrow_up:
go-1.20 98.63% <ø> (?)
macos-latest 98.63% <ø> (+0.36%) :arrow_up:
ubuntu-latest 98.63% <ø> (+0.36%) :arrow_up:

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
render/json.go 82.75% <0.00%> (-0.39%) :arrow_down:
tree.go 100.00% <0.00%> (ø)
routergroup.go 100.00% <0.00%> (ø)
binding/toml.go 100.00% <0.00%> (ø)
test_helpers.go 100.00% <0.00%> (ø)
render/msgpack.go 100.00% <0.00%> (ø)
binding/binding.go 100.00% <0.00%> (ø)
binding/msgpack.go 100.00% <0.00%> (ø)
gin.go 99.19% <0.00%> (+<0.01%) :arrow_up:
context.go 97.97% <0.00%> (+0.01%) :arrow_up:
... and 3 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

codecov[bot] avatar Oct 16 '22 02:10 codecov[bot]

maybe we also add reference documentation link to comment of code.

thinkerou avatar Jan 17 '23 06:01 thinkerou

maybe we also add reference documentation link to comment of code.

@thinkerou Please take a look, thank you.

hopehook avatar Feb 08 '23 09:02 hopehook