Add golangci (#6418)

This commit is contained in:
kolaente 2019-06-12 21:41:28 +02:00 committed by techknowlogick
parent 5832f8d90d
commit f9ec2f89f2
147 changed files with 1046 additions and 774 deletions

View file

@ -133,7 +133,7 @@ func (c *Commit) ParentCount() int {
func isImageFile(data []byte) (string, bool) {
contentType := http.DetectContentType(data)
if strings.Index(contentType, "image/") != -1 {
if strings.Contains(contentType, "image/") {
return contentType, true
}
return contentType, false
@ -206,8 +206,7 @@ func CommitChanges(repoPath string, opts CommitChangesOptions) error {
}
func commitsCount(repoPath, revision, relpath string) (int64, error) {
var cmd *Command
cmd = NewCommand("rev-list", "--count")
cmd := NewCommand("rev-list", "--count")
cmd.AddArguments(revision)
if len(relpath) > 0 {
cmd.AddArguments("--", relpath)
@ -263,7 +262,7 @@ type SearchCommitsOptions struct {
All bool
}
// NewSearchCommitsOptions contruct a SearchCommitsOption from a space-delimited search string
// NewSearchCommitsOptions construct a SearchCommitsOption from a space-delimited search string
func NewSearchCommitsOptions(searchString string, forAllRefs bool) SearchCommitsOptions {
var keywords, authors, committers []string
var after, before string