Skip to content

Commit 851e411

Browse files
committed
Fix err fmt when logger is invalid
Signed-off-by: Qifan Deng <[email protected]>
1 parent f153975 commit 851e411

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pkg/llm-d-inference-sim/simulator.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ package llmdinferencesim
2020
import (
2121
"context"
2222
"encoding/json"
23+
"errors"
2324
"fmt"
2425
"net"
2526
"os"
@@ -743,8 +744,7 @@ func (s *VllmSimulator) getDisplayedModelName(reqModel string) string {
743744

744745
func (s *VllmSimulator) showConfig(tgtLgr logr.Logger) error {
745746
if tgtLgr == logr.Discard() {
746-
err := fmt.Errorf("target logger is nil, cannot show configuration")
747-
return err
747+
return errors.New("target logger is nil, cannot show configuration")
748748
}
749749
cfgJSON, err := json.Marshal(s.config)
750750
if err != nil {

0 commit comments

Comments
 (0)