Skip to content

Commit 1a80d14

Browse files
committedJan 6, 2021
Support cross-platform paths for local files
Fixes #14
1 parent 0b4c5b1 commit 1a80d14

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed
 

‎pkg/local_storage.go

+3-2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package main
33
import (
44
"io"
55
"os"
6+
"path/filepath"
67

78
"github.com/grafana/grafana-plugin-sdk-go/backend"
89
"github.com/grafana/grafana-plugin-sdk-go/backend/log"
@@ -26,10 +27,10 @@ func newLocalStorage(instance *dataSourceInstance, logger log.Logger) (*localSto
2627
}
2728

2829
func (c *localStorage) Open() (io.ReadCloser, error) {
29-
return os.Open(c.settings.URL)
30+
return os.Open(filepath.ToSlash(c.settings.URL))
3031
}
3132

3233
func (c *localStorage) Stat() error {
33-
_, err := os.Stat(c.settings.URL)
34+
_, err := os.Stat(filepath.ToSlash(c.settings.URL))
3435
return err
3536
}

0 commit comments

Comments
 (0)
Please sign in to comment.