Skip to content

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

@gfl-chris

Description

@gfl-chris

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

go version go1.12.9 linux/amd64

and

Go Playground (1.13.4)

Does this issue reproduce with the latest release?

Yes. (Go Playground)

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

go env Output
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/ceineke/.cache/go-build"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/ceineke/.gvm/pkgsets/go1.12.9/global"
GOPROXY=""
GORACE=""
GOROOT="/home/ceineke/.gvm/gos/go1.12.9"
GOTMPDIR=""
GOTOOLDIR="/home/ceineke/.gvm/gos/go1.12.9/pkg/tool/linux_amd64"
GCCGO="gccgo"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD=""
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build732428512=/tmp/go-build -gno-record-gcc-switches"
and
Go Playground

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    DocumentationIssues describing a change to documentation.NeedsFixThe path to resolution is known, but the work has not been done.help wanted

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions