golang/go

os: ExpandEnv: Missing curly bracket at end of string substitutes var name whether or not env var is set

Open

#35,752 opened on Nov 21, 2019

View on GitHub
 (10 comments) (2 reactions) (0 assignees)Go (19,008 forks)batch import
DocumentationNeedsFixhelp wanted

Repository metrics

Stars
 (133,883 stars)
PR merge metrics
 (No merged PRs in 30d)

Description

What version of Go are you using (go version)?

and

Does this issue reproduce with the latest release?

Yes. (Go Playground)

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

What did you do?

https://play.golang.org/p/GSfBKiZqj2L

What did you expect to see?

Either

Hello, ${name
Hello, ${name

or

Hello, ${name
Hello, foo

What did you see instead?

Hello, name
Hello, name

Contributor guide