From a7ce8e5f46ec5c3f397605a77b5038c72823c675 Mon Sep 17 00:00:00 2001 From: Cabinfever_B Date: Wed, 31 Jan 2024 15:04:55 +0800 Subject: [PATCH] address comment Signed-off-by: Cabinfever_B --- pkg/parser/format/format.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pkg/parser/format/format.go b/pkg/parser/format/format.go index 998fc5bbc78fd..68a0269e4b745 100644 --- a/pkg/parser/format/format.go +++ b/pkg/parser/format/format.go @@ -34,7 +34,7 @@ const ( // Formatter is an io.Writer extended formatter by a fmt.Printf like function Format. type Formatter interface { io.Writer - Format(format string, args ...any) (n int, errno error) + Format(format string, args ...interface{}) (n int, errno error) } type indentFormatter struct { @@ -82,7 +82,7 @@ func IndentFormatter(w io.Writer, indent string) Formatter { return &indentFormatter{w, []byte(indent), 0, stBOL} } -func (f *indentFormatter) format(flat bool, format string, args ...any) (n int, errno error) { +func (f *indentFormatter) format(flat bool, format string, args ...interface{}) (n int, errno error) { var buf = make([]byte, 0) for i := 0; i < len(format); i++ { c := format[i] @@ -161,7 +161,7 @@ func (f *indentFormatter) format(flat bool, format string, args ...any) (n int, } // Format implements Format interface. -func (f *indentFormatter) Format(format string, args ...any) (n int, errno error) { +func (f *indentFormatter) Format(format string, args ...interface{}) (n int, errno error) { return f.format(false, format, args...) } @@ -187,7 +187,7 @@ func FlatFormatter(w io.Writer) Formatter { } // Format implements Format interface. -func (f *flatFormatter) Format(format string, args ...any) (n int, errno error) { +func (f *flatFormatter) Format(format string, args ...interface{}) (n int, errno error) { return (*indentFormatter)(f).format(true, format, args...) } @@ -448,7 +448,7 @@ func (ctx *RestoreCtx) WritePlain(plainText string) { } // WritePlainf write the plain text into writer without any handling. -func (ctx *RestoreCtx) WritePlainf(format string, a ...any) { +func (ctx *RestoreCtx) WritePlainf(format string, a ...interface{}) { fmt.Fprintf(ctx.In, format, a...) }