Skip to content

Commit

Permalink
ebitenutil: deprecate some APIs
Browse files Browse the repository at this point in the history
  • Loading branch information
hajimehoshi committed Aug 4, 2022
1 parent c985010 commit 65654f0
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
7 changes: 7 additions & 0 deletions ebitenutil/file_js.go
Expand Up @@ -28,6 +28,13 @@ func (f *file) Close() error {
return nil
}

// OpenFile opens a file and returns a stream for its data.
//
// The path parts should be separated with slash '/' on any environments.
//
// OpenFile doesn't work on mobiles.
//
// Deprecated: as of v2.4. Use os.Open on desktops and http.Get on browsers instead.
func OpenFile(path string) (ReadSeekCloser, error) {
res, err := http.Get(path)
if err != nil {
Expand Down
4 changes: 3 additions & 1 deletion ebitenutil/file_notjs.go
Expand Up @@ -26,7 +26,9 @@ import (
//
// The path parts should be separated with slash '/' on any environments.
//
// Note that this doesn't work on mobiles.
// OpenFile doesn't work on mobiles.
//
// Deprecated: as of v2.4. Use os.Open on desktops and http.Get on browsers instead.
func OpenFile(path string) (ReadSeekCloser, error) {
return os.Open(filepath.FromSlash(path))
}
2 changes: 2 additions & 0 deletions ebitenutil/io.go
Expand Up @@ -19,6 +19,8 @@ import (
)

// ReadSeekCloser is io.ReadSeeker and io.Closer.
//
// Deprecated: as of v2.4. Use io.ReadSeekCloser instead.
type ReadSeekCloser interface {
io.ReadSeeker
io.Closer
Expand Down

0 comments on commit 65654f0

Please sign in to comment.