File tree 1 file changed +5
-3
lines changed
instrumentation/github.com/astaxie/beego/otelbeego/test
1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -21,6 +21,7 @@ import (
21
21
"net/http"
22
22
"net/http/httptest"
23
23
"os"
24
+ "path/filepath"
24
25
"strings"
25
26
"testing"
26
27
"time"
@@ -241,19 +242,20 @@ func TestRender(t *testing.T) {
241
242
beego .SetTemplateFSFunc (func () http.FileSystem {
242
243
return & assetfs.AssetFS {
243
244
Asset : func (path string ) ([]byte , error ) {
244
- if path == tplName {
245
+ if _ , f := filepath . Split ( path ); f == tplName {
245
246
return []byte (htmlStr ), nil
246
247
}
247
248
return nil , os .ErrNotExist
248
249
},
249
250
AssetDir : func (path string ) ([]string , error ) {
250
- if path == "" {
251
+ switch path {
252
+ case "" , `\` :
251
253
return []string {tplName }, nil
252
254
}
253
255
return nil , os .ErrNotExist
254
256
},
255
257
AssetInfo : func (path string ) (os.FileInfo , error ) {
256
- if path == tplName {
258
+ if _ , f := filepath . Split ( path ); f == tplName {
257
259
return & assetfs.FakeFile {
258
260
Path : path ,
259
261
Len : int64 (len (htmlStr )),
You can’t perform that action at this time.
0 commit comments