Fix linting errors
This commit is contained in:
@@ -25,6 +25,8 @@ const (
|
||||
ReleaseChannelSupport = "support"
|
||||
)
|
||||
|
||||
const jsonSuffix = ".json"
|
||||
|
||||
// SetIndexes sets the update registry indexes and also configures the registry
|
||||
// to use pre-releases based on the channel.
|
||||
func SetIndexes(
|
||||
@@ -51,12 +53,12 @@ func SetIndexes(
|
||||
|
||||
// Always add the stable index as a base.
|
||||
registry.AddIndex(updater.Index{
|
||||
Path: ReleaseChannelStable + ".json",
|
||||
Path: ReleaseChannelStable + jsonSuffix,
|
||||
AutoDownload: autoDownload,
|
||||
})
|
||||
|
||||
// Add beta index if in beta or staging channel.
|
||||
indexPath := ReleaseChannelBeta + ".json"
|
||||
indexPath := ReleaseChannelBeta + jsonSuffix
|
||||
if releaseChannel == ReleaseChannelBeta ||
|
||||
releaseChannel == ReleaseChannelStaging ||
|
||||
(releaseChannel == "" && indexExists(registry, indexPath)) {
|
||||
@@ -74,7 +76,7 @@ func SetIndexes(
|
||||
}
|
||||
|
||||
// Add staging index if in staging channel.
|
||||
indexPath = ReleaseChannelStaging + ".json"
|
||||
indexPath = ReleaseChannelStaging + jsonSuffix
|
||||
if releaseChannel == ReleaseChannelStaging ||
|
||||
(releaseChannel == "" && indexExists(registry, indexPath)) {
|
||||
registry.AddIndex(updater.Index{
|
||||
@@ -91,7 +93,7 @@ func SetIndexes(
|
||||
}
|
||||
|
||||
// Add support index if in support channel.
|
||||
indexPath = ReleaseChannelSupport + ".json"
|
||||
indexPath = ReleaseChannelSupport + jsonSuffix
|
||||
if releaseChannel == ReleaseChannelSupport ||
|
||||
(releaseChannel == "" && indexExists(registry, indexPath)) {
|
||||
registry.AddIndex(updater.Index{
|
||||
|
||||
@@ -226,7 +226,7 @@ func TriggerUpdate(forceIndexCheck, downloadAll bool) error {
|
||||
updateASAP = true
|
||||
|
||||
case !forceIndexCheck && !enableSoftwareUpdates() && !enableIntelUpdates():
|
||||
return fmt.Errorf("automatic updating is disabled")
|
||||
return errors.New("automatic updating is disabled")
|
||||
|
||||
default:
|
||||
if forceIndexCheck {
|
||||
@@ -254,7 +254,7 @@ func TriggerUpdate(forceIndexCheck, downloadAll bool) error {
|
||||
func DisableUpdateSchedule() error {
|
||||
switch module.Status() {
|
||||
case modules.StatusStarting, modules.StatusOnline, modules.StatusStopping:
|
||||
return fmt.Errorf("module already online")
|
||||
return errors.New("module already online")
|
||||
}
|
||||
|
||||
disableTaskSchedule = true
|
||||
|
||||
Reference in New Issue
Block a user