You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Running the package through a static analyzer results in the following findings:
1. rhc/rhc-0.2.4/util.go:129: suppressed_error: The error returned by the function "Parse("redhat_access/r/insights/platform/config-manager/v2/profiles/current")" is not explicitly checked.
2. rhc/rhc-0.2.4/util.go:129: remediation: Explicitly check the return error.
# 127| return "", fmt.Errorf("cannot get base URL: %w", err)
# 128| }
# 129|-> p, _ := url.Parse("redhat_access/r/insights/platform/config-manager/v2/profiles/current")
# 130| uString = base.ResolveReference(p).String()
# 131| }
1. rhc/rhc-0.2.4/util.go:120: suppressed_error: The error returned by the function "Parse("api/config-manager/v2/profiles/current")" is not explicitly checked.
2. rhc/rhc-0.2.4/util.go:120: remediation: Explicitly check the return error.
# 118| if strings.Contains(serverHost, "subscription.rhsm.redhat.com") {
# 119| baseURL, _ = url.Parse("https://cert.console.redhat.com")
# 120|-> p, _ := url.Parse("api/config-manager/v2/profiles/current")
# 121| uString = baseURL.ResolveReference(p).String()
# 122| } else {
1. rhc/rhc-0.2.4/util.go:119: suppressed_error: The error returned by the function "Parse("https://cert.console.redhat.com")" is not explicitly checked.
2. rhc/rhc-0.2.4/util.go:119: remediation: Explicitly check the return error.
# 117| // Check if it is the default api server
# 118| if strings.Contains(serverHost, "subscription.rhsm.redhat.com") {
# 119|-> baseURL, _ = url.Parse("https://cert.console.redhat.com")
# 120| p, _ := url.Parse("api/config-manager/v2/profiles/current")
# 121| uString = baseURL.ResolveReference(p).String()
1. rhc/rhc-0.2.4/util.go:107: suppressed_error: The error returned by the function "Parse("api/config-manager/v2/profiles/current")" is not explicitly checked.
2. rhc/rhc-0.2.4/util.go:107: remediation: Explicitly check the return error.
# 105| return "", fmt.Errorf("cannot get base URL: %w", err)
# 106| }
# 107|-> p, _ := url.Parse("api/config-manager/v2/profiles/current")
# 108| uString = base.ResolveReference(p).String()
# 109| } else {
1. rhc/rhc-0.2.4/main.go:236: suppressed_error: The error returned by the function "writer.Flush()" is not explicitly checked.
2. rhc/rhc-0.2.4/main.go:236: remediation: Explicitly check the return error.
# 234| }
# 235| }
# 236|-> _ = writer.Flush()
# 237| fmt.Print("\nOrganization: ")
# 238| _ = scanner.Scan()
1. rhc/rhc-0.2.4/main.go:233: suppressed_error: The error returned by the function "Fprint(writer, "\n")" is not explicitly checked.
2. rhc/rhc-0.2.4/main.go:233: remediation: Explicitly check the return error.
# 231| _, _ = fmt.Fprintf(writer, "%v\t", org)
# 232| if (i+1)%4 == 0 {
# 233|-> _, _ = fmt.Fprint(writer, "\n")
# 234| }
# 235| }
1. rhc/rhc-0.2.4/main.go:231: suppressed_error: The error returned by the function "Fprintf(writer, "%v\t", org)" is not explicitly checked.
2. rhc/rhc-0.2.4/main.go:231: remediation: Explicitly check the return error.
# 229| writer := tabwriter.NewWriter(os.Stdout, 0, 2, 2, ' ', 0)
# 230| for i, org := range orgs {
# 231|-> _, _ = fmt.Fprintf(writer, "%v\t", org)
# 232| if (i+1)%4 == 0 {
# 233| _, _ = fmt.Fprint(writer, "\n")
1. rhc/rhc-0.2.4/main.go:105: suppressed_error: The error returned by the function "w.Flush()" is not explicitly checked.
2. rhc/rhc-0.2.4/main.go:105: remediation: Explicitly check the return error.
# 103| }
# 104| }
# 105|-> _ = w.Flush()
# 106| if hasPriorityErrors(errorMessages, log.LevelError) {
# 107| return cli.Exit("", 1)
1. rhc/rhc-0.2.4/main.go:102: suppressed_error: The error returned by the function "Fprintf(w, "%v\t%v\t%v\n", logMsg.level, step, logMsg.message)" is not explicitly checked.
2. rhc/rhc-0.2.4/main.go:102: remediation: Explicitly check the return error.
# 100| for step, logMsg := range errorMessages {
# 101| if logMsg.level <= log.CurrentLevel() {
# 102|-> _, _ = fmt.Fprintf(w, "%v\t%v\t%v\n", logMsg.level, step, logMsg.message)
# 103| }
# 104| }
1. rhc/rhc-0.2.4/main.go:99: suppressed_error: The error returned by the function "Fprintln(w, "TYPE\tSTEP\tERROR\t")" is not explicitly checked.
2. rhc/rhc-0.2.4/main.go:99: remediation: Explicitly check the return error.
# 97| fmt.Printf("The following errors were encountered during %s:\n\n", action)
# 98| w := tabwriter.NewWriter(os.Stdout, 0, 0, 2, ' ', 0)
# 99|-> _, _ = fmt.Fprintln(w, "TYPE\tSTEP\tERROR\t")
# 100| for step, logMsg := range errorMessages {
# 101| if logMsg.level <= log.CurrentLevel() {
1. rhc/rhc-0.2.4/main.go:87: suppressed_error: The error returned by the function "Fprintf(w, "%v\t%v\t\n", step, duration.Truncate(1000000))" is not explicitly checked.
2. rhc/rhc-0.2.4/main.go:87: remediation: Explicitly check the return error.
# 85| _, _ = fmt.Fprintln(w, "STEP\tDURATION\t")
# 86| for step, duration := range durations {
# 87|-> _, _ = fmt.Fprintf(w, "%v\t%v\t\n", step, duration.Truncate(time.Millisecond))
# 88| }
# 89| _ = w.Flush()
1. rhc/rhc-0.2.4/main.go:85: suppressed_error: The error returned by the function "Fprintln(w, "STEP\tDURATION\t")" is not explicitly checked.
2. rhc/rhc-0.2.4/main.go:85: remediation: Explicitly check the return error.
# 83| fmt.Println()
# 84| w := tabwriter.NewWriter(os.Stdout, 0, 0, 2, ' ', 0)
# 85|-> _, _ = fmt.Fprintln(w, "STEP\tDURATION\t")
# 86| for step, duration := range durations {
# 87| _, _ = fmt.Fprintf(w, "%v\t%v\t\n", step, duration.Truncate(time.Millisecond))
The text was updated successfully, but these errors were encountered:
Running the package through a static analyzer results in the following findings:
The text was updated successfully, but these errors were encountered: