Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Convert strings and slices using the officially recommended way #3344

Merged
merged 5 commits into from Mar 2, 2023

Conversation

hopehook
Copy link
Contributor

@hopehook hopehook commented Oct 1, 2022

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

Reference: golang/go#53003

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

hopehook commented Oct 1, 2022

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

@hopehook hopehook changed the title Feat: Convert strings and slices using the officially recommended way. Convert strings and slices using the officially recommended way Oct 2, 2022
@appleboy
Copy link
Member

Please add a reference documentation link.

@appleboy
Copy link
Member

please rebase the master branch.

@codecov
Copy link

codecov bot commented Oct 16, 2022

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%) ⬆️
go-1.17 ?
go-1.18 98.54% <ø> (+0.36%) ⬆️
go-1.19 98.63% <ø> (+0.36%) ⬆️
go-1.20 98.63% <ø> (?)
macos-latest 98.63% <ø> (+0.36%) ⬆️
ubuntu-latest 98.63% <ø> (+0.36%) ⬆️

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%) ⬇️
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%) ⬆️
context.go 97.97% <0.00%> (+0.01%) ⬆️
... 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.

@thinkerou thinkerou added this to the v1.10 milestone Jan 17, 2023
@thinkerou
Copy link
Member

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

@hopehook
Copy link
Contributor Author

hopehook commented Feb 8, 2023

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

@thinkerou Please take a look, thank you.

internal/bytesconv/bytesconv_1.20.go Outdated Show resolved Hide resolved
appleboy
appleboy previously approved these changes Feb 9, 2023
@@ -2,6 +2,9 @@
// Use of this source code is governed by a MIT style
// license that can be found in the LICENSE file.

//go:build !go1.20
// +build !go1.20
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please remove +build !go1.20, because we support min go version = 1.18

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

// license that can be found in the LICENSE file.

//go:build go1.20
// +build go1.20
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as above.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks.

go.mod Show resolved Hide resolved
@thinkerou thinkerou merged commit a889c58 into gin-gonic:master Mar 2, 2023
@thinkerou thinkerou modified the milestones: v1.10, v1.9.1 Jun 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants