mirror of
				https://github.com/maride/pancap.git
				synced 2025-10-10 19:36:51 +00:00 
			
		
		
		
	Add trailing newline to output if it's not present yet
This commit is contained in:
		
							parent
							
								
									22da3cc934
								
							
						
					
					
						commit
						0051217bb5
					
				| @ -3,6 +3,7 @@ package output | ||||
| import ( | ||||
| 	"fmt" | ||||
| 	"github.com/fatih/color" | ||||
| 	"strings" | ||||
| ) | ||||
| 
 | ||||
| const ( | ||||
| @ -42,8 +43,13 @@ func PrintBlock(headline string, content string) { | ||||
| 		content = cutContent(content) | ||||
| 	} | ||||
| 
 | ||||
| 	// And print our content. | ||||
| 	// Print our content. | ||||
| 	fmt.Print(content) | ||||
| 
 | ||||
| 	// Check if we need to add a newline character at the end | ||||
| 	if !strings.HasSuffix(content, "\n") { | ||||
| 		fmt.Print("\n") | ||||
| 	} | ||||
| } | ||||
| 
 | ||||
| // Cut content after MaxContentLines lines | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user