pkg/upgrade/upgrade.go
Function downloadAndInstall
has 13 return statements (exceeds 4 allowed). Open
Open
func downloadAndInstall(client *http.Client, url string) error {
temp, err := os.CreateTemp("", "*.zip")
if err != nil {
return err
}
Function downloadAndInstall
has 56 lines of code (exceeds 50 allowed). Consider refactoring. Open
Open
func downloadAndInstall(client *http.Client, url string) error {
temp, err := os.CreateTemp("", "*.zip")
if err != nil {
return err
}
Function NeedsUpgrade
has 5 return statements (exceeds 4 allowed). Open
Open
func NeedsUpgrade(ctx context.Context, client *http.Client, version string) (url string, latestVersion string, upgrade bool, err error) {
latestVersion, url, err = util.GetManifest(client, runtime.GOOS, runtime.GOARCH)
if err != nil {
v := "https://github.com/kubenetworks/kubevpn/raw/master/plugins/stable.txt"
var stream []byte