From 2949197d5106863e749ab9a9f2952c46232bb5e5 Mon Sep 17 00:00:00 2001 From: shiroyk Date: Sat, 30 Nov 2024 23:46:12 +0800 Subject: [PATCH] fix: redundant name check --- executor.go | 6 ------ 1 file changed, 6 deletions(-) diff --git a/executor.go b/executor.go index a53cfe7..8463ffd 100644 --- a/executor.go +++ b/executor.go @@ -53,9 +53,6 @@ var reName = regexp.MustCompile(`^[a-zA-Z0-9_]+$`) // Register registers the NewExecutor with the given name. // Valid name characters: a-zA-Z0-9_ func Register(name string, fn NewExecutor) { - if name == "" { - panic("ski: invalid pattern") - } if fn == nil { panic("ski: NewExecutor is nil") } @@ -88,9 +85,6 @@ func Registers(e NewExecutors) { defer executors.Unlock() for name, fn := range e { - if name == "" { - panic("ski: invalid pattern") - } if fn == nil { panic("ski: NewExecutor is nil") }