Fix potential nil pointer problem when using multierror pkg (#1311)
This commit is contained in:
@@ -297,7 +297,7 @@ func (fr *FissionResources) validateFunctionReference(functions map[string]bool,
|
||||
}
|
||||
|
||||
func (fr *FissionResources) Validate(c *cli.Context) error {
|
||||
var result *multierror.Error
|
||||
result := &multierror.Error{}
|
||||
|
||||
// check references: both dangling refs + garbage
|
||||
// packages -> archives
|
||||
|
||||
@@ -488,7 +488,7 @@ func fileChecksum(fileName string) (*fv1.Checksum, error) {
|
||||
// includeFiles, but is ignored if there's more than one includeFile.
|
||||
func createArchive(client *client.Client, includeFiles []string, noZip bool, specDir string, specFile string) *fv1.Archive {
|
||||
|
||||
var errs *multierror.Error
|
||||
errs := &multierror.Error{}
|
||||
|
||||
// check files existence
|
||||
for _, path := range includeFiles {
|
||||
|
||||
@@ -160,7 +160,7 @@ func readSpecs(specDir string) (*spec.FissionResources, error) {
|
||||
},
|
||||
}
|
||||
|
||||
var result *multierror.Error
|
||||
result := &multierror.Error{}
|
||||
|
||||
// Users can organize the specdir into subdirs if they want to.
|
||||
err := filepath.Walk(specDir, func(path string, info os.FileInfo, err error) error {
|
||||
|
||||
Reference in New Issue
Block a user