Commit 57ae2e73 authored by Shenghou Ma's avatar Shenghou Ma

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
parent a89aaad1
...@@ -9,7 +9,7 @@ package os ...@@ -9,7 +9,7 @@ package os
import "syscall" import "syscall"
// Expand replaces ${var} or $var in the string based on the mapping function. // 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 { func Expand(s string, mapping func(string) string) string {
buf := make([]byte, 0, 2*len(s)) buf := make([]byte, 0, 2*len(s))
// ${} is all ASCII, so bytes are fine for this operation. // ${} is all ASCII, so bytes are fine for this operation.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment