Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add os.read_file() #85

Merged
merged 1 commit into from
Feb 7, 2019
Merged

add os.read_file() #85

merged 1 commit into from
Feb 7, 2019

Conversation

ripienaar
Copy link
Contributor

No description provided.

@ripienaar
Copy link
Contributor Author

used readfile not read_file since you already have readlink

@d5
Copy link
Owner

d5 commented Feb 6, 2019

It's not a strict rule, but, I tried to respect Go equivalent function's Camelcase. For example. readlink was os.Readlink. So I think it should be read_file as it's matching ioutil.ReadFile.

@@ -63,6 +63,7 @@ os := import("os")
- `lookup_env(key string) => string/false`: retrieves the value of the environment variable named by the key.
- `mkdir(name string, perm int) => error `: creates a new directory with the specified name and permission bits (before umask).
- `mkdir_all(name string, perm int) => error `: creates a directory named path, along with any necessary parents, and returns nil, or else returns an error.
- `readfile(name string) => array(byte)/error `: reads the contents of a file into a byte array
Copy link
Owner

@d5 d5 Feb 6, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should be => bytes/error to make it consistent with other docs. "Bytes" is a single type in Tengo.

@ripienaar
Copy link
Contributor Author

ripienaar commented Feb 7, 2019

updated

@ripienaar ripienaar changed the title add os.readfile() add os.read_file() Feb 7, 2019
@ripienaar
Copy link
Contributor Author

travis needs to be reran was an environmental failure

@d5 d5 merged commit e81380b into d5:master Feb 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants