mirror of
https://github.com/openshift/source-to-image.git
synced 2026-02-06 06:44:58 +01:00
Allow incremental --as-dockerfile builds. Trello card: https://trello.com/c/P6TZg0wO/1582-5-builds-s2i-incremental-build-as-dockerfile
22 lines
438 B
Go
22 lines
438 B
Go
package util
|
|
|
|
// Includes determines if the given string is in the provided slice of strings.
|
|
func Includes(arr []string, str string) bool {
|
|
for _, s := range arr {
|
|
if s == str {
|
|
return true
|
|
}
|
|
}
|
|
return false
|
|
}
|
|
|
|
// FirstNonEmpty returns the first non-empty string in the provided list of strings.
|
|
func FirstNonEmpty(args ...string) string {
|
|
for _, value := range args {
|
|
if len(value) > 0 {
|
|
return value
|
|
}
|
|
}
|
|
return ""
|
|
}
|