internal/rpmmd: replace RepositoryError with plain error
The `RepositoryError` structure was weirdly used instead of a plan `error` type and added no value. Delete it and replace its only use with plain `error`. Signed-off-by: Tomáš Hozza <thozza@redhat.com>
This commit is contained in:
parent
2c794c9e94
commit
d0a3ad470d
1 changed files with 1 additions and 9 deletions
|
|
@ -178,14 +178,6 @@ type PackageInfo struct {
|
|||
Dependencies []PackageSpec `json:"dependencies,omitempty"`
|
||||
}
|
||||
|
||||
type RepositoryError struct {
|
||||
msg string
|
||||
}
|
||||
|
||||
func (re *RepositoryError) Error() string {
|
||||
return re.msg
|
||||
}
|
||||
|
||||
func GetVerStrFromPackageSpecList(pkgs []PackageSpec, packageName string) (string, error) {
|
||||
for _, pkg := range pkgs {
|
||||
if pkg.Name == packageName {
|
||||
|
|
@ -310,7 +302,7 @@ func LoadRepositories(confPaths []string, distro string) (map[string][]RepoConfi
|
|||
}
|
||||
|
||||
if repoConfigs == nil {
|
||||
return nil, &RepositoryError{"LoadRepositories failed: none of the provided paths contain distro configuration"}
|
||||
return nil, fmt.Errorf("LoadRepositories failed: none of the provided paths contain distro configuration")
|
||||
}
|
||||
|
||||
return repoConfigs, nil
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue