Skip to content

Commit 162b8df

Browse files
author
pixel
committed
修复路径分割不同系统分隔符不同导致的panic
1 parent 55e2109 commit 162b8df

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

server/service/sys_auto_code.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ func PreviewTemp(autoCode model.AutoCodeStruct) (map[string]string, error) {
8080
builder.Write(data)
8181
builder.WriteString("\n\n```")
8282

83-
pathArr := strings.Split(value.autoCodePath, "\\")
83+
pathArr := strings.Split(value.autoCodePath, string(os.PathSeparator))
8484
ret[pathArr[1]+"-"+pathArr[3]] = builder.String()
8585
_ = f.Close()
8686

0 commit comments

Comments
 (0)