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

interp,syntax: replace single case switches #255

Merged
merged 2 commits into from Jun 23, 2018
Merged

interp,syntax: replace single case switches #255

merged 2 commits into from Jun 23, 2018

Conversation

quasilyte
Copy link
Contributor

Usually makes code simpler.
There are no TODO notes, so I've treated
these switches as refactoring artifacts.

Usually makes code simpler.
There are no TODO notes, so I've treated
these switches as refactoring artifacts.
Copy link
Owner

@mvdan mvdan left a comment

Choose a reason for hiding this comment

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

Revert one of the three please - otherwise LGTM.

interp/module.go Outdated
@@ -132,8 +132,7 @@ func DefaultOpen(ctx Ctxt, path string, flag int, perm os.FileMode) (io.ReadWrit

func OpenDevImpls(next ModuleOpen) ModuleOpen {
return func(ctx Ctxt, path string, flag int, perm os.FileMode) (io.ReadWriteCloser, error) {
switch ctx.UnixPath(path) {
case "/dev/null":
if ctx.UnixPath(path) == "/dev/null" {
Copy link
Owner

Choose a reason for hiding this comment

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

please leave this as is - it's likely we're going to add others here, like /dev/urandom and /dev/zero.

@quasilyte
Copy link
Contributor Author

Done. (You may want to squash merge as I didn't --amend this commit.)

@mvdan mvdan merged commit ce58175 into mvdan:master Jun 23, 2018
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.

None yet

2 participants