From: Shenghou Ma Date: Mon, 17 Dec 2012 15:37:02 +0000 (+0800) Subject: os: fix docs for Expand X-Git-Tag: go1.1rc2~1609 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=57ae2e7371de9c7c5c2f6314baf95ca8b94a61d8;p=gostls13.git os: fix docs for Expand there is no concept of “undefined” variables for Expand。 R=golang-dev, rsc CC=golang-dev https://golang.org/cl/6946063 --- diff --git a/src/pkg/os/env.go b/src/pkg/os/env.go index eb265f2413..db7fc72b8a 100644 --- a/src/pkg/os/env.go +++ b/src/pkg/os/env.go @@ -9,7 +9,7 @@ package os import "syscall" // Expand replaces ${var} or $var in the string based on the mapping function. -// Invocations of undefined variables are replaced with the empty string. +// For example, os.ExpandEnv(s) is equivalent to os.Expand(s, os.Getenv). func Expand(s string, mapping func(string) string) string { buf := make([]byte, 0, 2*len(s)) // ${} is all ASCII, so bytes are fine for this operation.