From fbdce2547f43fdd8184cd906790cd107562734ca Mon Sep 17 00:00:00 2001 From: Doug Davis Date: Tue, 10 Nov 2015 12:57:51 -0800 Subject: [PATCH] convert map value from struct to bool Just for @calavera !! :-) Per: https://github.com/docker/docker/pull/17789#discussion_r44333133 Signed-off-by: Doug Davis --- builder/dockerfile/evaluator.go | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/builder/dockerfile/evaluator.go b/builder/dockerfile/evaluator.go index d6e628b8d6..0080a9968b 100644 --- a/builder/dockerfile/evaluator.go +++ b/builder/dockerfile/evaluator.go @@ -29,17 +29,17 @@ import ( ) // Environment variable interpolation will happen on these statements only. -var replaceEnvAllowed = map[string]struct{}{ - command.Env: {}, - command.Label: {}, - command.Add: {}, - command.Copy: {}, - command.Workdir: {}, - command.Expose: {}, - command.Volume: {}, - command.User: {}, - command.StopSignal: {}, - command.Arg: {}, +var replaceEnvAllowed = map[string]bool{ + command.Env: true, + command.Label: true, + command.Add: true, + command.Copy: true, + command.Workdir: true, + command.Expose: true, + command.Volume: true, + command.User: true, + command.StopSignal: true, + command.Arg: true, } // Certain commands are allowed to have their args split into more @@ -163,11 +163,11 @@ func (b *Builder) dispatch(stepN int, ast *parser.Node) error { ast = ast.Next var str string str = ast.Value - if _, ok := replaceEnvAllowed[cmd]; ok { + if replaceEnvAllowed[cmd] { var err error var words []string - if _, ok := allowWordExpansion[cmd]; ok { + if allowWordExpansion[cmd] { words, err = ProcessWords(str, envs) if err != nil { return err