Skip to content

Commit 7ca5035

Browse files
eeisegnagustingroh
authored andcommitted
linter cleanup
1 parent f7540a3 commit 7ca5035

File tree

17 files changed

+35
-39
lines changed

17 files changed

+35
-39
lines changed

cmd/cli/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* along with this program. If not, see <https://www.gnu.org/licenses/>.
1515
*/
1616

17-
// Package main load the Vulnerability CLI
17+
// Package main load the Vulnerability CLI.
1818
package main
1919

2020
func main() {

cmd/server/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* along with this program. If not, see <https://www.gnu.org/licenses/>.
1515
*/
1616

17-
// Package main loads the gRPC Vulnerability Server Service
17+
// Package main loads the gRPC Vulnerability Server Service.
1818
package main
1919

2020
import (

pkg/adapters/vulnerability_support.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ func FromCpeComponentOutputToComponentCpesResponse(input []dtos.CpeComponentOutp
173173
return response, nil
174174
}
175175

176-
// FromCpeComponentOutputToComponentCpesResponse converts an internal CPE Output structure into Component CPE Info.
176+
// FromCpeComponentOutputToComponentsCpesResponse FromCpeComponentOutputToComponentCpesResponse converts an internal CPE Output structure into Component CPE Info.
177177
func FromCpeComponentOutputToComponentsCpesResponse(input []dtos.CpeComponentOutput) (*pb.ComponentsCpesResponse, error) {
178178
componentsInfo, err := getComponentCPEInfo(input)
179179
if err != nil {

pkg/cmd/cli.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,4 @@
1616

1717
package cmd
1818

19-
// TODO Add CLI code processing here
19+
// TODO Add CLI code processing here.

pkg/cmd/doc.go

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,10 @@
1414
* along with this program. If not, see <https://www.gnu.org/licenses/>.
1515
*/
1616

17-
// Package cmd handles any command line driven interfaces to the Vulnerability service
18-
// It is currently made up of:
19-
// - Server Service
20-
// - Command line interface (CLI)
17+
/*
18+
Package cmd handles any command line driven interfaces to the Vulnerability service.
19+
It is currently made up of:
20+
- Server Service
21+
- Command line interface (CLI)
22+
*/
2123
package cmd

pkg/dtos/vulnerability_output_test.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,7 @@ func TestEmptyVulnerabilitiesOutput(t *testing.T) {
4444
t.Log("Parsed output object: ", output)
4545
}
4646
func TestVulnerabilitiesOutput(t *testing.T) {
47-
/*CVE-2019-15619
48-
CVE-2019-15619*/
47+
// CVE-2019-15619 CVE-2019-15619
4948
var outputJSON = `{
5049
"purls": [
5150
{

pkg/models/all_urls_test.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -211,8 +211,7 @@ func TestAllUrlsSearchVersion(t *testing.T) {
211211
allUrls, err = allUrlsModel.GetURLsByPurlString("pkg:gem/tablestyle", "22.22.22") // Shouldn't exist
212212
if err != nil {
213213
t.Errorf("all_urls.GetURLsByPurlString() error = failed to find purl by version string")
214-
}
215-
if len(allUrls.PurlName) > 0 {
214+
} else if len(allUrls.PurlName) > 0 {
216215
t.Errorf("all_urls.GetURLsByPurlString() error = Found match, when we shouldn't: %v", allUrls)
217216
}
218217
}

pkg/models/common.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* along with this program. If not, see <https://www.gnu.org/licenses/>.
1515
*/
1616

17-
// This file common tasks for the models package
17+
// This file common tasks for the models package.
1818

1919
package models
2020

pkg/models/cpe_purl.go

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -132,18 +132,15 @@ func FilterCpesByRequirement(cpes []CpePurl, purlReq string) []CpePurl {
132132
zlog.S.Infof("No cpes in filterCpes()")
133133
return []CpePurl{}
134134
}
135-
136135
var c *semver.Constraints
137-
138136
if len(purlReq) > 0 {
139137
zlog.S.Debugf("Building version constraint for %v", purlReq)
140138
var err error
141139
c, err = semver.NewConstraint(purlReq)
142140
if err != nil {
143-
zlog.S.Warnf("Encountered an issue parsing version constraint string '%v' (%v,%v): %v", purlReq, err)
141+
zlog.S.Warnf("Encountered an issue parsing version constraint string '%v': %v", purlReq, err)
144142
}
145143
}
146-
147144
zlog.S.Debugf("Filtering cpes by requirement...")
148145
output := []CpePurl{}
149146
for _, cpe := range cpes {

pkg/models/docs.go

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,15 @@
1414
* along with this program. If not, see <https://www.gnu.org/licenses/>.
1515
*/
1616

17-
// Package models contains all the logic required to interact with the SCANOSS database.
18-
// It provides data structures to represent the data retrieved from the system.
19-
// Current models/tables supported are:
20-
// - Mines
21-
// - Licenses
22-
// - Versions
23-
// - Projects
24-
// - All URLs
25-
// - Golang Projects
17+
/*
18+
Package models contains all the logic required to interact with the SCANOSS database.
19+
It provides data structures to represent the data retrieved from the system.
20+
Current models/tables supported are:
21+
- Mines
22+
- Licenses
23+
- Versions
24+
- Projects
25+
- All URLs
26+
- Golang Projects
27+
*/
2628
package models

0 commit comments

Comments
 (0)