24 lines
		
	
	
		
			537 B
		
	
	
	
		
			Go
		
	
	
	
	
	
			
		
		
	
	
			24 lines
		
	
	
		
			537 B
		
	
	
	
		
			Go
		
	
	
	
	
	
| package ecs
 | |
| 
 | |
| // ECS system by jcerise, github.com/jcerise/gogue
 | |
| 
 | |
| // IntInSlice will return true if the integer value provided is present in the slice provided, false otherwise.
 | |
| func IntInSlice(a int, list []int) bool {
 | |
| 	for _, b := range list {
 | |
| 		if b == a {
 | |
| 			return true
 | |
| 		}
 | |
| 	}
 | |
| 	return false
 | |
| }
 | |
| 
 | |
| // TypeInSlice will return true if the reflect.Type provided is present in the slice provided, false otherwise.
 | |
| func TypeInSlice(a string, list []string) bool {
 | |
| 	for _, b := range list {
 | |
| 		if b == a {
 | |
| 			return true
 | |
| 		}
 | |
| 	}
 | |
| 	return false
 | |
| }
 |