Skip to content

Commit

Permalink
Fix linters
Browse files Browse the repository at this point in the history
  • Loading branch information
lucapette committed Jan 20, 2019
1 parent 6bf0cf1 commit 1ca9334
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ func generatorsHelp(generators fakedata.Generators) string {
buffer := &bytes.Buffer{}
pattern := fmt.Sprintf("%%-%ds%%s\n", max+2) //+2 makes the output more readable
for _, gen := range generators {
fmt.Fprintf(buffer, pattern, gen.Name, gen.Desc)
fmt.Fprintf(buffer, pattern, gen.Name, gen.Desc) // nolint: errcheck
}

return buffer.String()
Expand Down Expand Up @@ -94,7 +94,7 @@ func main() {
)

flag.Usage = func() {
fmt.Fprintf(os.Stdout, "Usage: fakedata [option ...] field...\n\n")
fmt.Print("Usage: fakedata [option ...] field...\n\n")
flag.PrintDefaults()
}
flag.Parse()
Expand Down
2 changes: 1 addition & 1 deletion pkg/fakedata/column.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ func (columns Columns) GenerateRow(formatter Formatter) string {
values[i] = column.Generate()
}

fmt.Fprintf(row, "%s", formatter.Format(columns, values))
fmt.Fprintf(row, "%s", formatter.Format(columns, values)) // nolint: errcheck

return row.String()
}
4 changes: 2 additions & 2 deletions pkg/fakedata/completion.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,11 @@ func GetCompletionFunc(shell string) (string, error) {
allCliArgs := &bytes.Buffer{}

for _, gen := range NewGenerators() {
fmt.Fprintf(gens, gen.Name+" ")
fmt.Fprintf(gens, gen.Name+" ") // nolint: errcheck
}

pflag.VisitAll(func(f *pflag.Flag) {
fmt.Fprintf(allCliArgs, "--%s ", f.Name)
fmt.Fprintf(allCliArgs, "--%s ", f.Name) // nolint: errcheck
})

cmdList := gens.String() + " " + allCliArgs.String()
Expand Down
2 changes: 1 addition & 1 deletion pkg/fakedata/formatter.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ func (f *SQLFormatter) Format(columns Columns, values []string) string {
formattedValues[i] = fmt.Sprintf("'%s'", value)
}

fmt.Fprintf(sql,
fmt.Fprintf(sql, // nolint: errcheck
"INSERT INTO %s (%s) VALUES (%s);",
f.Table,
strings.Join(names, ","),
Expand Down

0 comments on commit 1ca9334

Please sign in to comment.