-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathres-data.go
44 lines (39 loc) · 834 Bytes
/
res-data.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
package deeptest
import (
"embed"
_file "github.com/deeptest-com/deeptest-next/pkg/libs/file"
"os"
)
//go:embed res
var resFileSys embed.FS
func ReadResData(pth string) (ret []byte, err error) {
if _file.IsRelease() {
ret, err = resFileSys.ReadFile(pth)
} else {
ret, err = os.ReadFile(pth)
}
return
}
////go:embed internal/agent/_prompt_templ
//var promptFileSys embed.FS
//
//func ReadPromptTempl(pth string) (ret string, err error) {
// var bytes []byte
//
// if commonUtils.IsRelease() {
// bytes, err = promptFileSys.ReadFile(pth)
// } else {
// currentPath, _ := os.Getwd()
//
// fullPath := filepath.Join(currentPath, "internal", "agent", "_prompt_templ", pth)
// bytes, err = os.ReadFile(fullPath)
// }
//
// if err != nil {
// _logUtils.Infof(err.Error())
// }
//
// ret = string(bytes)
//
// return
//}