Skip to content

Commit c7b5458

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

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"
@@ -717,8 +718,7 @@ func (s *VllmSimulator) getDisplayedModelName(reqModel string) string {
717718

718719
func (s *VllmSimulator) showConfig(tgtLgr logr.Logger) error {
719720
if tgtLgr == logr.Discard() {
720-
err := fmt.Errorf("target logger is nil, cannot show configuration")
721-
return err
721+
return errors.New("target logger is nil, cannot show configuration")
722722
}
723723
cfgJSON, err := json.Marshal(s.config)
724724
if err != nil {

0 commit comments

Comments
 (0)