diff --git a/internal/updater/channels.go b/internal/updater/channels.go index 0583ed43..ff787063 100644 --- a/internal/updater/channels.go +++ b/internal/updater/channels.go @@ -27,3 +27,7 @@ const ( // EarlyChannel is the channel users subscribe to when they enable "Early Access". EarlyChannel UpdateChannel = "early" ) + +// DefaultUpdateChannel is the default update channel to subscribe to. +// It is set to the stable channel by default, unless overridden at build time. +var DefaultUpdateChannel = StableChannel // nolint[gochecknoglobals] diff --git a/internal/updater/updater.go b/internal/updater/updater.go index 58769458..65297c22 100644 --- a/internal/updater/updater.go +++ b/internal/updater/updater.go @@ -66,10 +66,10 @@ func New( curVer *semver.Version, updateURLName, platform string, ) *Updater { - // If there's some unexpected value in the preferences, we force it back onto the stable channel. + // If there's some unexpected value in the preferences, we force it back onto the default channel. // This prevents users from screwing up silent updates by modifying their prefs.json file. if channel := UpdateChannel(s.Get(settings.UpdateChannelKey)); !(channel == StableChannel || channel == EarlyChannel) { - s.Set(settings.UpdateChannelKey, string(StableChannel)) + s.Set(settings.UpdateChannelKey, string(DefaultUpdateChannel)) } return &Updater{