]> Cypherpunks repositories - gostls13.git/commitdiff
os: fix docs for Expand
authorShenghou Ma <minux.ma@gmail.com>
Mon, 17 Dec 2012 15:37:02 +0000 (23:37 +0800)
committerShenghou Ma <minux.ma@gmail.com>
Mon, 17 Dec 2012 15:37:02 +0000 (23:37 +0800)
there is no concept of “undefined” variables for Expand。

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/6946063

src/pkg/os/env.go

index eb265f24138f2337028a602e9e58c4a7c0e19793..db7fc72b8a4d11d4993d1aba53994c86422760b9 100644 (file)
@@ -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.