From 4de758b93ecf5a8769b91a930c245f30d7327c08 Mon Sep 17 00:00:00 2001 From: lminzhw Date: Wed, 26 Jun 2019 21:10:14 +0800 Subject: [PATCH] fix golint / UT --- cmd/kube-batch/app/server.go | 1 - pkg/scheduler/util/assert/assert.go | 3 +++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/cmd/kube-batch/app/server.go b/cmd/kube-batch/app/server.go index 600d7fd0a1..a2d7d493f3 100644 --- a/cmd/kube-batch/app/server.go +++ b/cmd/kube-batch/app/server.go @@ -20,7 +20,6 @@ import ( "context" "fmt" "net/http" - _ "net/http/pprof" "os" "time" diff --git a/pkg/scheduler/util/assert/assert.go b/pkg/scheduler/util/assert/assert.go index 9593b00fb3..0ff84f0db0 100644 --- a/pkg/scheduler/util/assert/assert.go +++ b/pkg/scheduler/util/assert/assert.go @@ -9,6 +9,7 @@ import ( ) const ( + // EnvPanicOnError is the env name to determine panic on assertion failed or not EnvPanicOnError = "PANIC_ON_ERROR" ) @@ -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 @@ -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