Lint (#700)
* adjust GNUmakefile by using ... wildcard go command excludes vendored packages from ... wildcard Go1.9 or later * fix vet warnings * fmt
This commit is contained in:
		
				
					committed by
					
						
						Kota Kanbe
					
				
			
			
				
	
			
			
			
						parent
						
							ea800e04bc
						
					
				
				
					commit
					d785fc2a54
				
			@@ -760,7 +760,7 @@ func (o *debian) getCveIDsFromChangelog(
 | 
			
		||||
 | 
			
		||||
	// Only logging the error.
 | 
			
		||||
	o.log.Warnf("Failed to find the version in changelog: %s-%s", name, ver)
 | 
			
		||||
	o.log.Debugf("Changelog of : %s-%s", name, ver, changelog)
 | 
			
		||||
	o.log.Debugf("Changelog of : %s-%s-%s", name, ver, changelog)
 | 
			
		||||
 | 
			
		||||
	// If the version is not in changelog, return entire changelog to put into cache
 | 
			
		||||
	pack := o.Packages[name]
 | 
			
		||||
 
 | 
			
		||||
@@ -279,7 +279,7 @@ func (o *bsd) parsePkgVersion(stdout string) models.Packages {
 | 
			
		||||
				NewVersion: candidate,
 | 
			
		||||
			}
 | 
			
		||||
		case ">":
 | 
			
		||||
			o.log.Warn("The installed version of the %s is newer than the current version. *This situation can arise with an out of date index file, or when testing new ports.*", name)
 | 
			
		||||
			o.log.Warnf("The installed version of the %s is newer than the current version. *This situation can arise with an out of date index file, or when testing new ports.*", name)
 | 
			
		||||
			packs[name] = models.Package{
 | 
			
		||||
				Name:    name,
 | 
			
		||||
				Version: ver,
 | 
			
		||||
 
 | 
			
		||||
@@ -57,7 +57,7 @@ func detectRedhat(c config.ServerInfo) (itsMe bool, red osTypeInterface) {
 | 
			
		||||
 | 
			
		||||
	if r := exec(c, "ls /etc/fedora-release", noSudo); r.isSuccess() {
 | 
			
		||||
		red.setDistro(config.Fedora, "unknown")
 | 
			
		||||
		util.Log.Warn("Fedora not tested yet: %s", r)
 | 
			
		||||
		util.Log.Warnf("Fedora not tested yet: %s", r)
 | 
			
		||||
		return true, red
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
@@ -68,7 +68,7 @@ func detectRedhat(c config.ServerInfo) (itsMe bool, red osTypeInterface) {
 | 
			
		||||
			re := regexp.MustCompile(`(.*) release (\d[\d\.]*)`)
 | 
			
		||||
			result := re.FindStringSubmatch(strings.TrimSpace(r.Stdout))
 | 
			
		||||
			if len(result) != 3 {
 | 
			
		||||
				util.Log.Warn("Failed to parse Oracle Linux version: %s", r)
 | 
			
		||||
				util.Log.Warnf("Failed to parse Oracle Linux version: %s", r)
 | 
			
		||||
				return true, red
 | 
			
		||||
			}
 | 
			
		||||
 | 
			
		||||
@@ -85,7 +85,7 @@ func detectRedhat(c config.ServerInfo) (itsMe bool, red osTypeInterface) {
 | 
			
		||||
			re := regexp.MustCompile(`(.*) release (\d[\d\.]*)`)
 | 
			
		||||
			result := re.FindStringSubmatch(strings.TrimSpace(r.Stdout))
 | 
			
		||||
			if len(result) != 3 {
 | 
			
		||||
				util.Log.Warn("Failed to parse CentOS version: %s", r)
 | 
			
		||||
				util.Log.Warnf("Failed to parse CentOS version: %s", r)
 | 
			
		||||
				return true, red
 | 
			
		||||
			}
 | 
			
		||||
 | 
			
		||||
@@ -95,7 +95,7 @@ func detectRedhat(c config.ServerInfo) (itsMe bool, red osTypeInterface) {
 | 
			
		||||
				red.setDistro(config.CentOS, release)
 | 
			
		||||
				return true, red
 | 
			
		||||
			default:
 | 
			
		||||
				util.Log.Warn("Failed to parse CentOS: %s", r)
 | 
			
		||||
				util.Log.Warnf("Failed to parse CentOS: %s", r)
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
@@ -109,7 +109,7 @@ func detectRedhat(c config.ServerInfo) (itsMe bool, red osTypeInterface) {
 | 
			
		||||
			re := regexp.MustCompile(`(.*) release (\d[\d\.]*)`)
 | 
			
		||||
			result := re.FindStringSubmatch(strings.TrimSpace(r.Stdout))
 | 
			
		||||
			if len(result) != 3 {
 | 
			
		||||
				util.Log.Warn("Failed to parse RedHat/CentOS version: %s", r)
 | 
			
		||||
				util.Log.Warnf("Failed to parse RedHat/CentOS version: %s", r)
 | 
			
		||||
				return true, red
 | 
			
		||||
			}
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -67,7 +67,7 @@ func detectSUSE(c config.ServerInfo) (bool, osTypeInterface) {
 | 
			
		||||
						return true, s
 | 
			
		||||
					}
 | 
			
		||||
				}
 | 
			
		||||
				util.Log.Warn("Failed to parse SUSE Linux version: %s", r)
 | 
			
		||||
				util.Log.Warnf("Failed to parse SUSE Linux version: %s", r)
 | 
			
		||||
				return true, s
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
@@ -85,14 +85,14 @@ func (o *suse) parseOSRelease(content string) (name string, ver string) {
 | 
			
		||||
	} else if strings.Contains(content, `NAME="SLES_SAP"`) {
 | 
			
		||||
		name = config.SUSEEnterpriseServer
 | 
			
		||||
	} else {
 | 
			
		||||
		util.Log.Warn("Failed to parse SUSE edition: %s", content)
 | 
			
		||||
		util.Log.Warnf("Failed to parse SUSE edition: %s", content)
 | 
			
		||||
		return "unknown", "unknown"
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	re := regexp.MustCompile(`VERSION_ID=\"(.+)\"`)
 | 
			
		||||
	result := re.FindStringSubmatch(strings.TrimSpace(content))
 | 
			
		||||
	if len(result) != 2 {
 | 
			
		||||
		util.Log.Warn("Failed to parse SUSE Linux version: %s", content)
 | 
			
		||||
		util.Log.Warnf("Failed to parse SUSE Linux version: %s", content)
 | 
			
		||||
		return "unknown", "unknown"
 | 
			
		||||
	}
 | 
			
		||||
	return name, result[1]
 | 
			
		||||
 
 | 
			
		||||
@@ -46,7 +46,7 @@ func isRunningKernel(pack models.Package, family string, kernel models.Kernel) (
 | 
			
		||||
		return false, false
 | 
			
		||||
 | 
			
		||||
	default:
 | 
			
		||||
		util.Log.Warnf("Reboot required is not implemented yet: %s, %s", family, kernel)
 | 
			
		||||
		util.Log.Warnf("Reboot required is not implemented yet: %s, %v", family, kernel)
 | 
			
		||||
	}
 | 
			
		||||
	return false, false
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user