21 lines
284 B
Go
21 lines
284 B
Go
package main
|
|
|
|
import (
|
|
"fmt"
|
|
"os"
|
|
)
|
|
|
|
func main() {
|
|
mapper := func(placeholderName string) string {
|
|
switch placeholderName {
|
|
case "DAY_PART":
|
|
return "morning"
|
|
case "NAME":
|
|
return "Gopher"
|
|
}
|
|
return ""
|
|
}
|
|
|
|
fmt.Println(os.Expand("Good ${DAY_PART}, $NAME!", mapper))
|
|
}
|