builder/parser: Rewrite Parse() to use := instead of var

Docker-DCO-1.1-Signed-off-by: Erik Hollensbe <github@hollensbe.org> (github: erikh)
This commit is contained in:
Erik Hollensbe 2014-08-10 04:05:34 -07:00
parent 135f54ccbf
commit 248f4c4f75
1 changed files with 1 additions and 4 deletions

View File

@ -88,14 +88,11 @@ func parseLine(line string) (string, *Node, error) {
// The main parse routine. Handles an io.ReadWriteCloser and returns the root
// of the AST.
func Parse(rwc io.Reader) (*Node, error) {
var child *Node
var line string
var err error
root := &Node{}
scanner := bufio.NewScanner(rwc)
for scanner.Scan() {
line, child, err = parseLine(strings.TrimSpace(scanner.Text()))
line, child, err := parseLine(strings.TrimSpace(scanner.Text()))
if err != nil {
return nil, err
}