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

os: os.ExpandEnv() inconsistent behavior with $- due to missing - as shell special parameter #16554

Closed
cuonglm opened this issue Jul 31, 2016 · 2 comments
Milestone

Comments

@cuonglm
Copy link
Member

cuonglm commented Jul 31, 2016

- is one of shell special parameters.

Function isShellSpecialVar() missed it so $- and ${-} is expanded inconsistently with os.ExpandEnv().


  1. What version of Go are you using (go version)?
    go version go1.6.3 linux/amd64

  2. What operating system and processor architecture are you using (go env)?

    GOARCH="amd64"
    GOBIN=""
    GOEXE=""
    GOHOSTARCH="amd64"
    GOHOSTOS="linux"
    GOOS="linux"
    GOPATH="/home/cuonglm/go"
    GORACE=""
    GOROOT="/home/cuonglm/sources/go"
    GOTOOLDIR="/home/cuonglm/sources/go/pkg/tool/linux_amd64"
    GO15VENDOREXPERIMENT="1"
    CC="gcc"
    GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0"
    CXX="g++"
    CGO_ENABLED="1"
    
  3. What did you do?
    https://play.golang.org/p/EfqG4gN1so

  4. What did you expect to see?

    <nil>
    dash true
    dash
    dash
    
  5. What did you see instead?

    <nil>
    dash true
    -
    dash
    
@cuonglm cuonglm changed the title os: os.ExpandEnv() inconsistent behavior with $- due to missing - as shell special variable os: os.ExpandEnv() inconsistent behavior with $- due to missing - as shell special parameter Jul 31, 2016
@gopherbot
Copy link

CL https://golang.org/cl/25352 mentions this issue.

@quentinmit quentinmit added this to the Go1.8 milestone Aug 1, 2016
@cuonglm
Copy link
Member Author

cuonglm commented Aug 10, 2016

@quentinmit Would you mind reviewing https://golang.org/cl/25352 ?

@golang golang locked and limited conversation to collaborators Aug 21, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants