Deprecate CheckFatal in favour of assert package.
This commit is contained in:
		
							parent
							
								
									f93f662d7e
								
							
						
					
					
						commit
						a01b7ae657
					
				
							
								
								
									
										11
									
								
								lib/lib.go
								
								
								
								
							
							
						
						
									
										11
									
								
								lib/lib.go
								
								
								
								
							| 
						 | 
					@ -13,7 +13,7 @@ var progname = filepath.Base(os.Args[0])
 | 
				
			||||||
// ProgName returns what lib thinks the program name is, namely the
 | 
					// ProgName returns what lib thinks the program name is, namely the
 | 
				
			||||||
// basename of of argv0.
 | 
					// basename of of argv0.
 | 
				
			||||||
//
 | 
					//
 | 
				
			||||||
// It is similar to the Linux __progname.
 | 
					// It is similar to the Linux __progname function.
 | 
				
			||||||
func ProgName() string {
 | 
					func ProgName() string {
 | 
				
			||||||
	return progname
 | 
						return progname
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					@ -55,15 +55,6 @@ func Err(exit int, err error, format string, a ...interface{}) {
 | 
				
			||||||
	os.Exit(exit)
 | 
						os.Exit(exit)
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// CheckFatal calls Err if err isn't nil.
 | 
					 | 
				
			||||||
func CheckFatal(err error, format string, a ...interface{}) {
 | 
					 | 
				
			||||||
	if err == nil {
 | 
					 | 
				
			||||||
		return
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	Err(ExitFailure, err, format, a...)
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
// Itoa provides cheap integer to fixed-width decimal ASCII.  Give a
 | 
					// Itoa provides cheap integer to fixed-width decimal ASCII.  Give a
 | 
				
			||||||
// negative width to avoid zero-padding. Adapted from the 'itoa'
 | 
					// negative width to avoid zero-padding. Adapted from the 'itoa'
 | 
				
			||||||
// function in the log/log.go file in the standard library.
 | 
					// function in the log/log.go file in the standard library.
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue