You cannot select more than 25 topics
			Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
		
		
		
		
		
			
		
			
	
	
		
			25 lines
		
	
	
		
			291 B
		
	
	
	
		
			Go
		
	
		
		
			
		
	
	
			25 lines
		
	
	
		
			291 B
		
	
	
	
		
			Go
		
	
| 
											2 years ago
										 | package tools | ||
|  | 
 | ||
|  | import ( | ||
|  | 	"fmt" | ||
|  | ) | ||
|  | 
 | ||
|  | func AssertNil(v interface{}) { | ||
|  | 	if !IsNil(v) { | ||
|  | 		panic(v) | ||
|  | 	} | ||
|  | } | ||
|  | 
 | ||
|  | func AssertNotNil(v interface{}) { | ||
|  | 	if IsNil(v) { | ||
|  | 		panic(v) | ||
|  | 	} | ||
|  | } | ||
|  | 
 | ||
|  | func AssertTrue(b bool, msg string, param ...interface{}) { | ||
|  | 	if !b { | ||
|  | 		info := fmt.Sprintf(msg, param...) | ||
|  | 		panic(info) | ||
|  | 	} | ||
|  | } |