From 40b701a058c55229bb3946ceef10059654fd7896 Mon Sep 17 00:00:00 2001 From: Shaba Abhiram Date: Fri, 11 Dec 2020 11:06:01 -0800 Subject: [PATCH] update go-gitignore's usage to remove impossible error See #650 for history. Signed-off-by: Shaba Abhiram --- go.mod | 2 +- go.sum | 4 ++-- internal/commands/build.go | 10 ++-------- 3 files changed, 5 insertions(+), 11 deletions(-) diff --git a/go.mod b/go.mod index 28c9e9a43..2c5dda616 100644 --- a/go.mod +++ b/go.mod @@ -29,7 +29,7 @@ require ( github.com/opencontainers/selinux v1.6.0 // indirect github.com/pelletier/go-toml v1.8.1 github.com/pkg/errors v0.9.1 - github.com/sabhiram/go-gitignore v0.0.0-20180611051255-d3107576ba94 + github.com/sabhiram/go-gitignore v0.0.0-20201211074657-223ce5d391b0 github.com/sclevine/spec v1.4.0 github.com/sergi/go-diff v1.1.0 // indirect github.com/sirupsen/logrus v1.7.0 // indirect diff --git a/go.sum b/go.sum index 6c48990c2..8d3ae38e8 100644 --- a/go.sum +++ b/go.sum @@ -490,8 +490,8 @@ github.com/rubiojr/go-vhd v0.0.0-20160810183302-0bfd3b39853c/go.mod h1:DM5xW0nvf github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g= github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= -github.com/sabhiram/go-gitignore v0.0.0-20180611051255-d3107576ba94 h1:G04eS0JkAIVZfaJLjla9dNxkJCPiKIGZlw9AfOhzOD0= -github.com/sabhiram/go-gitignore v0.0.0-20180611051255-d3107576ba94/go.mod h1:b18R55ulyQ/h3RaWyloPyER7fWQVZvimKKhnI5OfrJQ= +github.com/sabhiram/go-gitignore v0.0.0-20201211074657-223ce5d391b0 h1:4Q/TASkyjpqyR5DL5+6c2FGSDpHM5bTMSspcXr7J6R8= +github.com/sabhiram/go-gitignore v0.0.0-20201211074657-223ce5d391b0/go.mod h1:b18R55ulyQ/h3RaWyloPyER7fWQVZvimKKhnI5OfrJQ= github.com/satori/go.uuid v1.2.0/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0= github.com/sclevine/spec v1.2.0/go.mod h1:W4J29eT/Kzv7/b9IWLB055Z+qvVC9vt0Arko24q7p+U= github.com/sclevine/spec v1.4.0 h1:z/Q9idDcay5m5irkZ28M7PtQM4aOISzOpj4bUPkDee8= diff --git a/internal/commands/build.go b/internal/commands/build.go index 287298ecb..c41ebf1dc 100644 --- a/internal/commands/build.go +++ b/internal/commands/build.go @@ -252,19 +252,13 @@ func parseProjectToml(appPath, descriptorPath string) (project.Descriptor, strin func getFileFilter(descriptor project.Descriptor) (func(string) bool, error) { if len(descriptor.Build.Exclude) > 0 { - excludes, err := ignore.CompileIgnoreLines(descriptor.Build.Exclude...) - if err != nil { - return nil, err - } + excludes := ignore.CompileIgnoreLines(descriptor.Build.Exclude...) return func(fileName string) bool { return !excludes.MatchesPath(fileName) }, nil } if len(descriptor.Build.Include) > 0 { - includes, err := ignore.CompileIgnoreLines(descriptor.Build.Include...) - if err != nil { - return nil, err - } + includes := ignore.CompileIgnoreLines(descriptor.Build.Include...) return includes.MatchesPath, nil }