mirror of
				https://github.com/1Password/onepassword-operator.git
				synced 2025-10-31 11:49:40 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			34 lines
		
	
	
		
			555 B
		
	
	
	
		
			Go
		
	
	
	
	
	
			
		
		
	
	
			34 lines
		
	
	
		
			555 B
		
	
	
	
		
			Go
		
	
	
	
	
	
| package utils
 | |
| 
 | |
| import (
 | |
| 	"strconv"
 | |
| 	"strings"
 | |
| )
 | |
| 
 | |
| func ContainsString(slice []string, s string) bool {
 | |
| 	for _, item := range slice {
 | |
| 		if item == s {
 | |
| 			return true
 | |
| 		}
 | |
| 	}
 | |
| 	return false
 | |
| }
 | |
| 
 | |
| func RemoveString(slice []string, s string) (result []string) {
 | |
| 	for _, item := range slice {
 | |
| 		if item == s {
 | |
| 			continue
 | |
| 		}
 | |
| 		result = append(result, item)
 | |
| 	}
 | |
| 	return
 | |
| }
 | |
| 
 | |
| func StringToBool(str string) (bool, error) {
 | |
| 	restartDeploymentBool, err := strconv.ParseBool(strings.ToLower(str))
 | |
| 	if err != nil {
 | |
| 		return false, err
 | |
| 	}
 | |
| 	return restartDeploymentBool, nil
 | |
| }
 | 
