refactor: use a more modern writing style to simplify code (#3834)

Signed-off-by: deepdring <deepdrink@icloud.com>
This commit is contained in:
deepdring
2025-08-26 08:00:51 +08:00
committed by GitHub
parent 094b02da4c
commit b8057f28c6
24 changed files with 98 additions and 100 deletions

View File

@@ -55,7 +55,7 @@ func (i *InfoBuf) Close() {
}
// Message sends a message to the user
func (i *InfoBuf) Message(msg ...interface{}) {
func (i *InfoBuf) Message(msg ...any) {
// only display a new message if there isn't an active prompt
// this is to prevent overwriting an existing prompt to the user
if !i.HasPrompt {
@@ -67,7 +67,7 @@ func (i *InfoBuf) Message(msg ...interface{}) {
}
// GutterMessage displays a message and marks it as a gutter message
func (i *InfoBuf) GutterMessage(msg ...interface{}) {
func (i *InfoBuf) GutterMessage(msg ...any) {
i.Message(msg...)
i.HasGutter = true
}
@@ -79,7 +79,7 @@ func (i *InfoBuf) ClearGutter() {
}
// Error sends an error message to the user
func (i *InfoBuf) Error(msg ...interface{}) {
func (i *InfoBuf) Error(msg ...any) {
// only display a new message if there isn't an active prompt
// this is to prevent overwriting an existing prompt to the user
if !i.HasPrompt {