Remove errors.Join usage for go1.19 compatibility

This commit is contained in:
5hir0kur0
2024-07-19 10:25:46 +09:00
committed by André Roth
parent 6d6761e234
commit 934fa0598b
+3 -5
View File
@@ -3,7 +3,6 @@ package deb
import (
gocontext "context"
"encoding/json"
"errors"
"fmt"
"path/filepath"
"strconv"
@@ -342,11 +341,10 @@ func (p *Package) MatchesArchitecture(arch string) bool {
// providesDependency checks if the package `Provide:`s the dependency, assuming that the architecture matches.
// If the `Provides:` entry includes a version number, it will be considered when checking the dependency.
func (p *Package) providesDependency(dep Dependency) (bool, error) {
var errs []error // won't cause an allocation in case of no errors
for _, provided := range p.Provides {
providedDep, err := ParseDependency(provided)
if err != nil {
errs = append(errs, err)
return false, err
}
// The only relation allowed here is `=`.
// > The relations allowed are [...]. The exception is the Provides field, for which only = is allowed.
@@ -365,10 +363,10 @@ func (p *Package) providesDependency(dep Dependency) (bool, error) {
return true, nil
}
default:
errs = append(errs, fmt.Errorf("unsupported relation in Provides: %s", providedDep.String()))
return false, fmt.Errorf("unsupported relation in Provides: %s", providedDep.String())
}
}
return false, errors.Join(errs...)
return false, nil
}
// MatchesDependency checks whether package matches specified dependency