Skip to content

Commit

Permalink
fix golint / UT
Browse files Browse the repository at this point in the history
  • Loading branch information
lminzhw committed Jun 28, 2019
1 parent 00fb1ce commit 4de758b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 0 additions & 1 deletion cmd/kube-batch/app/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import (
"context"
"fmt"
"net/http"
_ "net/http/pprof"
"os"
"time"

Expand Down
3 changes: 3 additions & 0 deletions pkg/scheduler/util/assert/assert.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
)

const (
// EnvPanicOnError is the env name to determine panic on assertion failed or not
EnvPanicOnError = "PANIC_ON_ERROR"
)

Expand All @@ -23,6 +24,7 @@ func init() {
}
}

// Assert check condition, if condition is false, print message by log or panic
func Assert(condition bool, message string) {
if condition {
return
Expand All @@ -33,6 +35,7 @@ func Assert(condition bool, message string) {
glog.Errorf("%s, %s", message, debug.Stack())
}

// Assertf check condition, if condition is false, print message using Assert
func Assertf(condition bool, format string, args ...interface{}) {
if condition {
return
Expand Down

0 comments on commit 4de758b

Please sign in to comment.