paketo-buildpacks / libpak

An opinionated extension to the libcnb Cloud Native Buildpack Library
Apache License 2.0
15 stars 18 forks source link

libpak should provide the slices.Contains utility #238

Closed anthonydahanne closed 3 months ago

anthonydahanne commented 1 year ago

Describe the Enhancement

Some buildpacks try to reproduce this common utility, it'd be better if it was available in libpak in the first place.

Motivation & Possible Solution

You can get this functionality from "golang.org/x/exp/slices" and even copy it from https://cs.opensource.google/go/x/exp/+/master:slices/slices.go

dmikusa commented 3 months ago

This is now in Go, finally, so we should switch buildpacks to use that.

https://pkg.go.dev/slices#Contains