Commit 40264832 authored by Mattia Bertorello's avatar Mattia Bertorello

Fixed all the problem reported by interfacer (replace with the interface when is possible)

These warnings were suppressed by putting the type in the name of the method
parent 0561a765
......@@ -25,7 +25,6 @@ linters:
- goconst
- gocyclo
- govet
- interfacer
- lll
- maligned
- megacheck
......
......@@ -111,9 +111,10 @@ func (platform *Platform) GetOrCreateRelease(version *semver.Version) (*Platform
return release, nil
}
// GetRelease returns the specified release corresponding the provided version,
// GetReleaseRelaxedVersion returns the specified release corresponding the provided version,
// or nil if not found.
func (platform *Platform) GetRelease(version *semver.Version) *PlatformRelease {
func (platform *Platform) GetReleaseVersion(version *semver.Version) *PlatformRelease {
// use as an fmt.Stringer
return platform.Releases[version.String()]
}
......@@ -124,7 +125,7 @@ func (platform *Platform) GetLatestRelease() *PlatformRelease {
if latestVersion == nil {
return nil
}
return platform.GetRelease(latestVersion)
return platform.GetReleaseVersion(latestVersion)
}
// GetAllReleasesVersions returns all the version numbers in this Platform Package.
......
......@@ -81,7 +81,7 @@ func (pm *PackageManager) FindPlatformReleaseDependencies(item *PlatformReferenc
var release *cores.PlatformRelease
if item.PlatformVersion != nil {
release = platform.GetRelease(item.PlatformVersion)
release = platform.GetReleaseVersion(item.PlatformVersion)
if release == nil {
return nil, nil, fmt.Errorf("required version %s not found for platform %s", item.PlatformVersion, platform.String())
}
......
......@@ -288,7 +288,7 @@ func (ta *ToolActions) Release(version *semver.RelaxedVersion) *ToolReleaseActio
if ta.forwardError != nil {
return &ToolReleaseActions{forwardError: ta.forwardError}
}
release := ta.tool.GetRelease(version)
release := ta.tool.GetReleaseRelaxedVersion(version)
if release == nil {
return &ToolReleaseActions{forwardError: fmt.Errorf("release %s not found for tool %s", version, ta.tool.String())}
}
......
......@@ -62,9 +62,9 @@ func (tool *Tool) GetOrCreateRelease(version *semver.RelaxedVersion) *ToolReleas
return release
}
// GetRelease returns the specified release corresponding the provided version,
// GetReleaseRelaxedVersion returns the specified release corresponding the provided version,
// or nil if not found.
func (tool *Tool) GetRelease(version *semver.RelaxedVersion) *ToolRelease {
func (tool *Tool) GetReleaseRelaxedVersion(version *semver.RelaxedVersion) *ToolRelease {
return tool.Releases[version.String()]
}
......@@ -86,7 +86,7 @@ func (tool *Tool) LatestRelease() *ToolRelease {
return nil
}
return tool.GetRelease(latest)
return tool.GetReleaseRelaxedVersion(latest)
}
// latestReleaseVersion obtains latest version number.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment