mirror of
				https://github.com/coredns/coredns.git
				synced 2025-11-02 10:13:14 -05:00 
			
		
		
		
	
		
			
	
	
		
			14 lines
		
	
	
		
			233 B
		
	
	
	
		
			Go
		
	
	
	
	
	
		
		
			
		
	
	
			14 lines
		
	
	
		
			233 B
		
	
	
	
		
			Go
		
	
	
	
	
	
| 
								 | 
							
								package plugin
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								import "context"
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								// Done is a non-blocking function that returns true if the context has been canceled.
							 | 
						||
| 
								 | 
							
								func Done(ctx context.Context) bool {
							 | 
						||
| 
								 | 
							
									select {
							 | 
						||
| 
								 | 
							
									case <-ctx.Done():
							 | 
						||
| 
								 | 
							
										return true
							 | 
						||
| 
								 | 
							
									default:
							 | 
						||
| 
								 | 
							
										return false
							 | 
						||
| 
								 | 
							
									}
							 | 
						||
| 
								 | 
							
								}
							 |