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:
parent
135f54ccbf
commit
248f4c4f75
1 changed files with 1 additions and 4 deletions
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue