From 3dd8e2d46533461e4e279589d595cd7fb4c75412 Mon Sep 17 00:00:00 2001 From: shawnps Date: Sat, 7 Feb 2015 07:25:05 -0800 Subject: [PATCH] golint fixes --- check/check.go | 2 ++ check/go_vet.go | 2 ++ check/gocyclo.go | 2 ++ check/gofmt.go | 2 ++ check/golint.go | 2 ++ check/utils.go | 4 ++++ 6 files changed, 14 insertions(+) diff --git a/check/check.go b/check/check.go index 0806221..4bf749a 100644 --- a/check/check.go +++ b/check/check.go @@ -1,5 +1,7 @@ package check +// Check describes what methods various checks (gofmt, go lint, etc.) +// should implement type Check interface { Name() string Description() string diff --git a/check/go_vet.go b/check/go_vet.go index f5e7e47..884a196 100644 --- a/check/go_vet.go +++ b/check/go_vet.go @@ -1,10 +1,12 @@ package check +// GoVet is the check for the go vet command type GoVet struct { Dir string Filenames []string } +// Name returns the name of the display name of the command func (g GoVet) Name() string { return "go_vet" } diff --git a/check/gocyclo.go b/check/gocyclo.go index 04bc5de..3e7c7b7 100644 --- a/check/gocyclo.go +++ b/check/gocyclo.go @@ -1,10 +1,12 @@ package check +// GoCycle is the check for the go cyclo command type GoCyclo struct { Dir string Filenames []string } +// Name returns the name of the display name of the command func (g GoCyclo) Name() string { return "gocyclo" } diff --git a/check/gofmt.go b/check/gofmt.go index 78fd079..b1451fa 100644 --- a/check/gofmt.go +++ b/check/gofmt.go @@ -1,10 +1,12 @@ package check +// GoFmt is the check for the go fmt command type GoFmt struct { Dir string Filenames []string } +// Name returns the name of the display name of the command func (g GoFmt) Name() string { return "gofmt" } diff --git a/check/golint.go b/check/golint.go index 4b9d70c..7c7df8a 100644 --- a/check/golint.go +++ b/check/golint.go @@ -1,10 +1,12 @@ package check +// GoLint is the check for the go lint command type GoLint struct { Dir string Filenames []string } +// Name returns the name of the display name of the command func (g GoLint) Name() string { return "golint" } diff --git a/check/utils.go b/check/utils.go index f335fcc..15f20ab 100644 --- a/check/utils.go +++ b/check/utils.go @@ -54,11 +54,15 @@ func lineCount(filepath string) (int, error) { return count, nil } +// Error contains the line number and the reason for +// an error output from a command type Error struct { LineNumber int `json:"line_number"` ErrorString string `json:"error_string"` } +// FileSummary contains the filename, location of the file +// on GitHub, and all of the errors related to the file type FileSummary struct { Filename string `json:"filename"` FileURL string `json:"file_url"`