-
Notifications
You must be signed in to change notification settings - Fork 291
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
Remove stdlib api functions now that we're on Go 1.23 #3639
Conversation
The latest Buf updates on your PR. Results from workflow Buf CI / buf (pull_request).
|
@@ -50,8 +51,11 @@ func newFiles[F InputFile]( | |||
} | |||
return files, nil | |||
} | |||
|
|||
chunks := slicesext.ToChunks(indexedInputFiles, chunkSize) | |||
// slices.Chunk panics if given a chunk size less than 1 - allocate a single chunk in this case. |
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.
This is one difference between the previous slicesext.ToChunks
implementation and the stdlib one, although it doesn't seem too bad in practice. If desired, I could re-add the method to slicesext and add this handling there but still re-use the stdlib method.
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.
Let's re-add the method to slicesext
with the handling encapsulated since the slicesext
package is staying, so I think it makes sense to minimize the impact of this.
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.
Added back in b52fd39 and re-added tests.
@@ -12,36 +12,6 @@ | |||
// See the License for the specific language governing permissions and | |||
// limitations under the License. | |||
|
|||
// Some implementations are copied from "slices", and hence |
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.
It looks like any methods from stdlib slices have been removed now so removed this notice.
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.
LGTM but I'd probably wait for a CLI code owner.
Add back the slicesext.ToChunks which has additional mitigations to prevent running into a panic in cases where the chunk size is 0.
No description provided.