1
0
mirror of https://github.com/SAP/jenkins-library.git synced 2025-01-18 05:18:24 +02:00
sap-jenkins-library/pkg/generator/helper/goUtils.go

30 lines
397 B
Go
Raw Normal View History

2019-11-12 14:55:32 +02:00
package helper
import (
"fmt"
"os"
)
func checkError(err error) {
if err != nil {
fmt.Printf("Error occured: %v\n", err)
os.Exit(1)
}
}
func contains(v []string, s string) bool {
for _, i := range v {
if i == s {
return true
}
}
return false
}
func ifThenElse(condition bool, positive string, negative string) string {
if condition {
return positive
}
return negative
}