1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

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

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
}