parent
e9b03930ce
commit
47062da36a
3 changed files with 8 additions and 1 deletions
4
.gitignore
vendored
4
.gitignore
vendored
|
@ -1 +1,3 @@
|
|||
dist/
|
||||
dist/
|
||||
|
||||
.idea
|
|
@ -6,6 +6,8 @@ os := import("os")
|
|||
|
||||
## Constants
|
||||
|
||||
- `platform`
|
||||
- `arch`
|
||||
- `o_rdonly`
|
||||
- `o_wronly`
|
||||
- `o_rdwr`
|
||||
|
|
|
@ -6,11 +6,14 @@ import (
|
|||
"io/ioutil"
|
||||
"os"
|
||||
"os/exec"
|
||||
"runtime"
|
||||
|
||||
"github.com/d5/tengo/v2"
|
||||
)
|
||||
|
||||
var osModule = map[string]tengo.Object{
|
||||
"platform": &tengo.String{Value: runtime.GOOS},
|
||||
"arch": &tengo.String{Value: runtime.GOARCH},
|
||||
"o_rdonly": &tengo.Int{Value: int64(os.O_RDONLY)},
|
||||
"o_wronly": &tengo.Int{Value: int64(os.O_WRONLY)},
|
||||
"o_rdwr": &tengo.Int{Value: int64(os.O_RDWR)},
|
||||
|
|
Loading…
Reference in a new issue