Chore: Enable goprintffuncname and nakedret linters (#26376)

* Chore: Enable goprintffuncname linter
* Chore: Enable nakedret linter

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
This commit is contained in:
Arve Knudsen
2020-07-23 08:14:39 +02:00
committed by GitHub
parent 9b17fe436c
commit 4c56eb3991
22 changed files with 53 additions and 51 deletions

View File

@ -50,7 +50,7 @@ func (pm *PluginManager) checkForUpdates() {
resp, err := httpClient.Get("https://grafana.com/api/plugins/versioncheck?slugIn=" + pluginSlugs + "&grafanaVersion=" + setting.BuildVersion)
if err != nil {
log.Trace("Failed to get plugins repo from grafana.com, %v", err.Error())
log.Tracef("Failed to get plugins repo from grafana.com, %v", err.Error())
return
}
@ -58,14 +58,14 @@ func (pm *PluginManager) checkForUpdates() {
body, err := ioutil.ReadAll(resp.Body)
if err != nil {
log.Trace("Update check failed, reading response from grafana.com, %v", err.Error())
log.Tracef("Update check failed, reading response from grafana.com, %v", err.Error())
return
}
gNetPlugins := []GrafanaNetPlugin{}
err = json.Unmarshal(body, &gNetPlugins)
if err != nil {
log.Trace("Failed to unmarshal plugin repo, reading response from grafana.com, %v", err.Error())
log.Tracef("Failed to unmarshal plugin repo, reading response from grafana.com, %v", err.Error())
return
}
@ -88,21 +88,21 @@ func (pm *PluginManager) checkForUpdates() {
resp2, err := httpClient.Get("https://raw.githubusercontent.com/grafana/grafana/master/latest.json")
if err != nil {
log.Trace("Failed to get latest.json repo from github.com: %v", err.Error())
log.Tracef("Failed to get latest.json repo from github.com: %v", err.Error())
return
}
defer resp2.Body.Close()
body, err = ioutil.ReadAll(resp2.Body)
if err != nil {
log.Trace("Update check failed, reading response from github.com, %v", err.Error())
log.Tracef("Update check failed, reading response from github.com, %v", err.Error())
return
}
var githubLatest GithubLatest
err = json.Unmarshal(body, &githubLatest)
if err != nil {
log.Trace("Failed to unmarshal github.com latest, reading response from github.com: %v", err.Error())
log.Tracef("Failed to unmarshal github.com latest, reading response from github.com: %v", err.Error())
return
}