17 lines
300 B
Go
17 lines
300 B
Go
package ass
|
|
|
|
import (
|
|
"fmt"
|
|
)
|
|
|
|
// Format 格式化ASS文件
|
|
func Format(filePath string) error {
|
|
// 读取ASS文件
|
|
assFile, err := Parse(filePath)
|
|
if err != nil {
|
|
return fmt.Errorf("解析ASS文件失败: %w", err)
|
|
}
|
|
|
|
// 写回格式化后的ASS文件
|
|
return Generate(assFile, filePath)
|
|
}
|