Skip to content

Commit

Permalink
Merge pull request #28 from saromanov/fix-deprecated-values
Browse files Browse the repository at this point in the history
os: use SeekStart, SeekCurrent and SeekEnd instead deprecated values
  • Loading branch information
d5 committed Jan 21, 2019
2 parents bf934d0 + c087ba8 commit a32ef0a
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions compiler/stdlib/os.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package stdlib

import (
"io"
"os"

"github.com/d5/tengo/objects"
Expand Down Expand Up @@ -32,9 +33,9 @@ var osModule = map[string]objects.Object{
"path_separator": &objects.Char{Value: os.PathSeparator},
"path_list_separator": &objects.Char{Value: os.PathListSeparator},
"dev_null": &objects.String{Value: os.DevNull},
"seek_set": &objects.Int{Value: int64(os.SEEK_SET)},
"seek_cur": &objects.Int{Value: int64(os.SEEK_CUR)},
"seek_end": &objects.Int{Value: int64(os.SEEK_END)},
"seek_set": &objects.Int{Value: int64(io.SeekStart)},
"seek_cur": &objects.Int{Value: int64(io.SeekCurrent)},
"seek_end": &objects.Int{Value: int64(io.SeekEnd)},
// args() => array(string)
"args": &objects.UserFunction{Value: osArgs},
// chdir(dir string) => error
Expand Down

0 comments on commit a32ef0a

Please sign in to comment.