Fix Command.Context comment (#1639)
This commit is contained in:
		
							
								
								
									
										11
									
								
								command.go
									
									
									
									
									
								
							
							
						
						
									
										11
									
								
								command.go
									
									
									
									
									
								
							@ -166,7 +166,7 @@ type Command struct {
 | 
				
			|||||||
	// errWriter is a writer defined by the user that replaces stderr
 | 
						// errWriter is a writer defined by the user that replaces stderr
 | 
				
			||||||
	errWriter io.Writer
 | 
						errWriter io.Writer
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	//FParseErrWhitelist flag parse errors to be ignored
 | 
						// FParseErrWhitelist flag parse errors to be ignored
 | 
				
			||||||
	FParseErrWhitelist FParseErrWhitelist
 | 
						FParseErrWhitelist FParseErrWhitelist
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	// CompletionOptions is a set of options to control the handling of shell completion
 | 
						// CompletionOptions is a set of options to control the handling of shell completion
 | 
				
			||||||
@ -224,8 +224,13 @@ type Command struct {
 | 
				
			|||||||
	SuggestionsMinimumDistance int
 | 
						SuggestionsMinimumDistance int
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// Context returns underlying command context. If command wasn't
 | 
					// Context returns underlying command context. If command was executed
 | 
				
			||||||
// executed with ExecuteContext Context returns Background context.
 | 
					// with ExecuteContext or the context was set with SetContext, the
 | 
				
			||||||
 | 
					// previously set context will be returned. Otherwise, nil is returned.
 | 
				
			||||||
 | 
					//
 | 
				
			||||||
 | 
					// Notice that a call to Execute and ExecuteC will replace a nil context of
 | 
				
			||||||
 | 
					// a command with a context.Background, so a background context will be
 | 
				
			||||||
 | 
					// returned by Context after one of these functions has been called.
 | 
				
			||||||
func (c *Command) Context() context.Context {
 | 
					func (c *Command) Context() context.Context {
 | 
				
			||||||
	return c.ctx
 | 
						return c.ctx
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user