mirror of
https://github.com/aptly-dev/aptly.git
synced 2026-06-05 05:20:34 +00:00
Remove errors.Join usage for go1.19 compatibility
This commit is contained in:
+3
-5
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user