浏览代码

builder: rewrote NewBuildFile according to tibor's comments

Docker-DCO-1.1-Signed-off-by: Erik Hollensbe <github@hollensbe.org> (github: erikh)
Erik Hollensbe 11 年之前
父节点
当前提交
bb36902db6
共有 1 个文件被更改,包括 2 次插入1 次删除
  1. 2 1
      builder/evaluator/evaluator.go

+ 2 - 1
builder/evaluator/evaluator.go

@@ -57,7 +57,8 @@ type BuildOpts struct {
 	AuthConfigFile  *registry.ConfigFile
 }
 
-func (opts *BuildOpts) NewBuildFile(file io.ReadWriteCloser) (*buildFile, error) {
+func NewBuildFile(file io.ReadWriteCloser, opts *BuildOpts) (*buildFile, error) {
+	defer file.Close()
 	ast, err := parser.Parse(file)
 	if err != nil {
 		return nil, err