Bumps [github.com/open-policy-agent/opa](https://github.com/open-policy-agent/opa) from 1.10.1 to 1.12.3. - [Release notes](https://github.com/open-policy-agent/opa/releases) - [Changelog](https://github.com/open-policy-agent/opa/blob/main/CHANGELOG.md) - [Commits](https://github.com/open-policy-agent/opa/compare/v1.10.1...v1.12.3) --- updated-dependencies: - dependency-name: github.com/open-policy-agent/opa dependency-version: 1.12.3 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Michal Klos <michal.klos@kiteworks.com>
14 lines
278 B
Go
14 lines
278 B
Go
package util
|
|
|
|
import "strings"
|
|
|
|
// WithPrefix ensures that the string s starts with the given prefix.
|
|
// If s already starts with prefix, it is returned unchanged.
|
|
func WithPrefix(s, prefix string) string {
|
|
if strings.HasPrefix(s, prefix) {
|
|
return s
|
|
}
|
|
|
|
return prefix + s
|
|
}
|