Files
AUTO-MAS-test/Go_Updater/assets/assets.go
AoXuan 6b646378b6 refactor(updater): 重构 Go 版本更新器
- 更新项目名称为 AUTO_MAA_Go_Updater
- 重构代码结构,优化函数命名和逻辑
- 移除 CDK 相关的冗余代码
- 调整版本号为 git commit hash
- 更新构建配置和脚本
- 优化 API 客户端实现
2025-07-22 21:51:58 +08:00

35 lines
681 B
Go

package assets
import (
"embed"
"io/fs"
)
//go:embed config_template.yaml
var EmbeddedAssets embed.FS
// GetConfigTemplate 返回嵌入的配置模板
func GetConfigTemplate() ([]byte, error) {
return EmbeddedAssets.ReadFile("config_template.yaml")
}
// GetAssetFS 返回嵌入的文件系统
func GetAssetFS() fs.FS {
return EmbeddedAssets
}
// ListAssets 返回所有嵌入资源的列表
func ListAssets() ([]string, error) {
var assets []string
err := fs.WalkDir(EmbeddedAssets, ".", func(path string, d fs.DirEntry, err error) error {
if err != nil {
return err
}
if !d.IsDir() {
assets = append(assets, path)
}
return nil
})
return assets, err
}