refactor: replace interface{} with any for modern Go style

Update callback function signatures to use the any alias introduced in Go 1.18,
improving code readability and following current Go conventions.

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
This commit is contained in:
2026-04-09 16:52:48 +08:00
parent 9f9b1ebac6
commit 2f06c696fa
2 changed files with 3 additions and 3 deletions

View File

@@ -34,13 +34,13 @@ type result struct {
var DefaultTTS = &AliTTS{}
// onTaskFailed TTS 合成失败回调
func (tts *AliTTS) onTaskFailed(text string, param interface{}) {
func (tts *AliTTS) onTaskFailed(text string, param any) {
p, _ := param.(*result)
p.Error = fmt.Errorf("语音合成异常: %v", text)
}
// onSynthesisResult TTS 合成数据回调
func (tts *AliTTS) onSynthesisResult(data []byte, param interface{}) {
func (tts *AliTTS) onSynthesisResult(data []byte, param any) {
p, _ := param.(*result)
p.Data.Write(data)
}