You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by "tylitianrui (via GitHub)" <gi...@apache.org> on 2023/03/28 03:19:49 UTC

[GitHub] [apisix-ingress-controller] tylitianrui opened a new pull request, #1750: StringToByte without mem-allocation supports v1.20

tylitianrui opened a new pull request, #1750:
URL: https://github.com/apache/apisix-ingress-controller/pull/1750

   <!-- Please answer these questions before submitting a pull request -->
   
   ### Type of change:
   
   <!-- Please delete options that are not relevant. -->
   
   <!-- Select all the options from below that matches the type your PR best -->
   
   - [ ] Bugfix
   - [ ] New feature provided
   - [ ] Improve performance
   - [ ] Backport patches
   - [ ] Documentation
   - [ ] Refactor
   - [x] Chore
   - [ ] CI/CD or Tests
   
   ### What this PR does / why we need it:
   Since Go 1.20, the [(Slice|String)Header types will be depreciated](https://github.com/golang/go/commit/bc2e961cf4cda945dc6d607a5076b4e376553e9f) and not recommended to be used.  
    Two functions, unsafe.StringData and unsafe.SliceData will  take over the use cases of two old reflect types.
   
   <!--- Why is this change required? What problem does it solve? -->
   <!--- If it fixes an open issue, please link to the issue here. -->
   
   ### Pre-submission checklist:
   
   <!--
   Please follow the requirements:
   1. Use Draft if the PR is not ready to be reviewed
   2. Test is required for the feat/fix PR, unless you have a good reason
   3. Doc is required for the feat PR
   4. Use a new commit to resolve review instead of `push -f`
   5. Use "request review" to notify the reviewer once you have resolved the review
   -->
   
   - [X] Did you explain what problem does this PR solve? Or what new features have been added?
   - [X] Have you added corresponding test cases?
   - [ ] Have you modified the corresponding document?
   - [ ] Is this PR backward compatible? **If it is not backward compatible, please discuss on the [mailing list](https://github.com/apache/apisix-ingress-controller#community) first**
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [apisix-ingress-controller] tao12345666333 commented on a diff in pull request #1750: StringToByte without mem-allocation supports v1.20

Posted by "tao12345666333 (via GitHub)" <gi...@apache.org>.
tao12345666333 commented on code in PR #1750:
URL: https://github.com/apache/apisix-ingress-controller/pull/1750#discussion_r1171971328


##########
pkg/utils/s2b_new.go:
##########
@@ -0,0 +1,26 @@
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements.  See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License.  You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+//go:build go1.20
+// +build go1.20
+
+package utils
+
+import "unsafe"
+
+// s2b converts string to a byte slice without memory allocation.

Review Comment:
   ```suggestion
   // String2Byte converts string to a byte slice without memory allocation.
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [apisix-ingress-controller] tao12345666333 commented on pull request #1750: StringToByte without mem-allocation supports v1.20

Posted by "tao12345666333 (via GitHub)" <gi...@apache.org>.
tao12345666333 commented on PR #1750:
URL: https://github.com/apache/apisix-ingress-controller/pull/1750#issuecomment-1491272173

   Thanks for your contribution.
   
   I think we should upgrade our Go tool chain to v1.20 first.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [apisix-ingress-controller] tao12345666333 merged pull request #1750: StringToByte without mem-allocation supports v1.20

Posted by "tao12345666333 (via GitHub)" <gi...@apache.org>.
tao12345666333 merged PR #1750:
URL: https://github.com/apache/apisix-ingress-controller/pull/1750


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [apisix-ingress-controller] codecov-commenter commented on pull request #1750: StringToByte without mem-allocation supports v1.20

Posted by "codecov-commenter (via GitHub)" <gi...@apache.org>.
codecov-commenter commented on PR #1750:
URL: https://github.com/apache/apisix-ingress-controller/pull/1750#issuecomment-1486253362

   ## [Codecov](https://codecov.io/gh/apache/apisix-ingress-controller/pull/1750?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
   > Merging [#1750](https://codecov.io/gh/apache/apisix-ingress-controller/pull/1750?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (99249e5) into [master](https://codecov.io/gh/apache/apisix-ingress-controller/commit/379e92ee2c6c55dad0fae7f31203281bebc89152?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (379e92e) will **increase** coverage by `0.02%`.
   > The diff coverage is `100.00%`.
   
   > :exclamation: Current head 99249e5 differs from pull request most recent head 0674289. Consider uploading reports for the commit 0674289 to get more accurate results
   
   ```diff
   @@            Coverage Diff             @@
   ##           master    #1750      +/-   ##
   ==========================================
   + Coverage   41.69%   41.71%   +0.02%     
   ==========================================
     Files          90       91       +1     
     Lines        7702     7705       +3     
   ==========================================
   + Hits         3211     3214       +3     
     Misses       4127     4127              
     Partials      364      364              
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/apisix-ingress-controller/pull/1750?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [pkg/id/idgen.go](https://codecov.io/gh/apache/apisix-ingress-controller/pull/1750?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cGtnL2lkL2lkZ2VuLmdv) | `100.00% <100.00%> (ø)` | |
   | [pkg/utils/s2b\_old.go](https://codecov.io/gh/apache/apisix-ingress-controller/pull/1750?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cGtnL3V0aWxzL3MyYl9vbGQuZ28=) | `100.00% <100.00%> (ø)` | |
   
   :mega: We’re building smart automated test selection to slash your CI/CD build times. [Learn more](https://about.codecov.io/iterative-testing/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [apisix-ingress-controller] tylitianrui commented on a diff in pull request #1750: StringToByte without mem-allocation supports v1.20

Posted by "tylitianrui (via GitHub)" <gi...@apache.org>.
tylitianrui commented on code in PR #1750:
URL: https://github.com/apache/apisix-ingress-controller/pull/1750#discussion_r1172596111


##########
pkg/utils/s2b_new.go:
##########
@@ -0,0 +1,26 @@
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements.  See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License.  You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+//go:build go1.20
+// +build go1.20
+
+package utils
+
+import "unsafe"
+
+// s2b converts string to a byte slice without memory allocation.

Review Comment:
   i finished it



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org