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

Commit e689678

Browse files
committed
First pass at getting go lint to pass.
1 parent 6eb7302 commit e689678

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

gomock/call.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -382,7 +382,7 @@ func (c *Call) matches(args []interface{}) error {
382382

383383
// Check that the call is not exhausted.
384384
if c.exhausted() {
385-
return fmt.Errorf("Expected call at %s has already been called the max number of times.", c.origin)
385+
return fmt.Errorf("expected call at %s has already been called the max number of times", c.origin)
386386
}
387387

388388
return nil

mockgen/model/model.go

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ type Package struct {
3333
DotImports []string
3434
}
3535

36+
// Print writes the package name and its exported interfaces.
3637
func (pkg *Package) Print(w io.Writer) {
3738
fmt.Fprintf(w, "package %s\n", pkg.Name)
3839
for _, intf := range pkg.Interfaces {
@@ -55,6 +56,7 @@ type Interface struct {
5556
Methods []*Method
5657
}
5758

59+
// Print writes the interface name and its methods.
5860
func (intf *Interface) Print(w io.Writer) {
5961
fmt.Fprintf(w, "interface %s\n", intf.Name)
6062
for _, m := range intf.Methods {
@@ -75,6 +77,7 @@ type Method struct {
7577
Variadic *Parameter // may be nil
7678
}
7779

80+
// Print writes the method name and its signature.
7881
func (m *Method) Print(w io.Writer) {
7982
fmt.Fprintf(w, " - method %s\n", m.Name)
8083
if len(m.In) > 0 {
@@ -113,6 +116,7 @@ type Parameter struct {
113116
Type Type
114117
}
115118

119+
// Print writes a method parameter.
116120
func (p *Parameter) Print(w io.Writer) {
117121
n := p.Name
118122
if n == "" {
@@ -183,6 +187,7 @@ func (ct *ChanType) addImports(im map[string]bool) { ct.Type.addImports(im) }
183187
// ChanDir is a channel direction.
184188
type ChanDir int
185189

190+
// Constants for channel directions.
186191
const (
187192
RecvDir ChanDir = 1
188193
SendDir ChanDir = 2
@@ -255,9 +260,9 @@ func (nt *NamedType) String(pm map[string]string, pkgOverride string) string {
255260
prefix := pm[nt.Package]
256261
if prefix != "" {
257262
return prefix + "." + nt.Type
258-
} else {
259-
return nt.Type
260263
}
264+
265+
return nt.Type
261266
}
262267
func (nt *NamedType) addImports(im map[string]bool) {
263268
if nt.Package != "" {
@@ -283,6 +288,8 @@ func (pt PredeclaredType) addImports(im map[string]bool)
283288

284289
// The following code is intended to be called by the program generated by ../reflect.go.
285290

291+
// InterfaceFromInterfaceType returns a pointer to an interface for the
292+
// given reflection interface type.
286293
func InterfaceFromInterfaceType(it reflect.Type) (*Interface, error) {
287294
if it.Kind() != reflect.Interface {
288295
return nil, fmt.Errorf("%v is not an interface", it)

0 commit comments

Comments
 (0)