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.
		
		
		
		
		
			
		
			
	
	
		
			18 lines
		
	
	
		
			251 B
		
	
	
	
		
			Go
		
	
		
		
			
		
	
	
			18 lines
		
	
	
		
			251 B
		
	
	
	
		
			Go
		
	
| 
											2 years ago
										 | package tools | ||
|  | 
 | ||
|  | import ( | ||
|  | 	"reflect" | ||
|  | 	"unsafe" | ||
|  | ) | ||
|  | 
 | ||
|  | //重置数据
 | ||
|  | func Reset(v interface{}) { | ||
|  | 	p := reflect.ValueOf(v).Elem() | ||
|  | 	p.Set(reflect.Zero(p.Type())) | ||
|  | } | ||
|  | 
 | ||
|  | //判空
 | ||
|  | func IsNil(i interface{}) bool { | ||
|  | 	return (*[2]uintptr)(unsafe.Pointer(&i))[1] == 0 | ||
|  | } |