Add golint to test (#255)
* Add a new lint rule to the Makefile Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com> * Fix linter errors Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com> * Allow replacing the default apt mirror Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
This commit is contained in:
committed by
Michael Crosby
parent
4176ba7b52
commit
5624732128
@@ -15,7 +15,7 @@ import (
|
||||
|
||||
const usage = `High performance container daemon cli`
|
||||
|
||||
type Exit struct {
|
||||
type exit struct {
|
||||
Code int
|
||||
}
|
||||
|
||||
@@ -23,7 +23,7 @@ func main() {
|
||||
// We want our defer functions to be run when calling fatal()
|
||||
defer func() {
|
||||
if e := recover(); e != nil {
|
||||
if ex, ok := e.(Exit); ok == true {
|
||||
if ex, ok := e.(exit); ok == true {
|
||||
os.Exit(ex.Code)
|
||||
}
|
||||
panic(e)
|
||||
@@ -86,5 +86,5 @@ var versionCommand = cli.Command{
|
||||
|
||||
func fatal(err string, code int) {
|
||||
fmt.Fprintf(os.Stderr, "[ctr] %s\n", err)
|
||||
panic(Exit{code})
|
||||
panic(exit{code})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user