Skip to content
This repository has been archived by the owner on Jun 27, 2023. It is now read-only.

fix several linting warnings #374

Merged
merged 2 commits into from Dec 27, 2019
Merged

fix several linting warnings #374

merged 2 commits into from Dec 27, 2019

Conversation

codyoss
Copy link
Member

@codyoss codyoss commented Dec 27, 2019

Description

Found a bunch of warnings in my editor so I fixed them.

Submitter Checklist

These are the criteria that every PR should meet, please check them off as you
review them:

  • Includes tests

Reviewer Notes

  • The code flow looks good.
  • Tests added.

Release Notes

N/A

@@ -305,14 +305,14 @@ func (g *generator) Generate(pkg *model.Package, pkgName string, outputPackagePa
g.p("")
g.p("import (")
g.in()
for path, pkg := range g.packageMap {
if path == outputPackagePath {
for pkgPath, pkg := range g.packageMap {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We import path so we should not name variables with the same name as the import.

@@ -158,7 +158,7 @@ func parseMockNames(names string) map[string]string {
}

func usage() {
io.WriteString(os.Stderr, usageText)
_, _ = io.WriteString(os.Stderr, usageText)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Being explicit.

@@ -283,8 +284,8 @@ func (pt *PointerType) addImports(im map[string]bool) { pt.Type.addImports(im) }
// PredeclaredType is a predeclared type such as "int".
type PredeclaredType string

func (pt PredeclaredType) String(pm map[string]string, pkgOverride string) string { return string(pt) }
func (pt PredeclaredType) addImports(im map[string]bool) {}
func (pt PredeclaredType) String(map[string]string, string) string { return string(pt) }
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If none of the parameters are used, don't name them.

@@ -757,7 +757,7 @@ func TestVariadicNoMatch(t *testing.T) {
ctrl.RecordCall(s, "VariadicMethod", 0)
rep.assertFatal(func() {
ctrl.Call(s, "VariadicMethod", 1)
}, "Expected call at", "doesn't match the argument at index 0",
}, "expected call at", "doesn't match the argument at index 0",
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

errors should not start with a capital letter

@codyoss codyoss requested a review from cvgw December 27, 2019 21:58
@codyoss codyoss merged commit 29da289 into golang:master Dec 27, 2019
@codyoss codyoss deleted the nitpicking branch December 27, 2019 23:20
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants