-
Notifications
You must be signed in to change notification settings - Fork 8.1k
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
Conversation
Go official is expected to provide unsafe.{SliceData, Slice, StringData, String} series methods in version 1.20 for conversion of strings and slices.
This change needs to wait for the release of go1.20, please review it at that time, thank you. |
Please add a reference documentation link. |
please rebase the master branch. |
Codecov Report
@@ 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
Flags with carried forward coverage won't be shown. Click here to find out more.
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
maybe we also add reference documentation link to comment of code. |
@thinkerou Please take a look, thank you. |
internal/bytesconv/bytesconv_1.19.go
Outdated
@@ -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 |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
internal/bytesconv/bytesconv_1.20.go
Outdated
// license that can be found in the LICENSE file. | ||
|
||
//go:build go1.20 | ||
// +build go1.20 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
as above.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks.
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