Docker-DCO-1.1-Signed-off-by: Erik Hollensbe <github@hollensbe.org> (github: erikh)
| ... | ... |
@@ -9,6 +9,7 @@ package parser |
| 9 | 9 |
import ( |
| 10 | 10 |
"encoding/json" |
| 11 | 11 |
"errors" |
| 12 |
+ "fmt" |
|
| 12 | 13 |
"strconv" |
| 13 | 14 |
"strings" |
| 14 | 15 |
) |
| ... | ... |
@@ -43,6 +44,11 @@ func parseEnv(rest string) (*Node, map[string]bool, error) {
|
| 43 | 43 |
node := &Node{}
|
| 44 | 44 |
rootnode := node |
| 45 | 45 |
strs := TOKEN_WHITESPACE.Split(rest, 2) |
| 46 |
+ |
|
| 47 |
+ if len(strs) < 2 {
|
|
| 48 |
+ return nil, nil, fmt.Errorf("ENV must have two arguments")
|
|
| 49 |
+ } |
|
| 50 |
+ |
|
| 46 | 51 |
node.Value = strs[0] |
| 47 | 52 |
node.Next = &Node{}
|
| 48 | 53 |
node.Next.Value = strs[1] |