Skip to content

Commit 9ff7004

Browse files
author
Juanjo Alvarez
committed
Formatting and convention fixes
Signed-off-by: Juanjo Alvarez <[email protected]>
1 parent 817f6b1 commit 9ff7004

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

internal/function/blame.go

+9-6
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,16 @@ import (
1515
)
1616

1717
type BlameGenerator struct {
18+
ctx *sql.Context
1819
commit *object.Commit
1920
fIter *object.FileIter
2021
curLine int
2122
curFile *object.File
2223
lines []*git.Line
23-
ctx *sql.Context
2424
}
2525

26-
func NewBlameGenerator(c *object.Commit, f *object.FileIter, ctx *sql.Context) (*BlameGenerator, error) {
27-
return &BlameGenerator{commit: c, fIter: f, curLine: -1, ctx: ctx}, nil
26+
func NewBlameGenerator(ctx *sql.Context, c *object.Commit, f *object.FileIter) (*BlameGenerator, error) {
27+
return &BlameGenerator{ctx: ctx, commit: c, fIter: f, curLine: -1}, nil
2828
}
2929

3030
func (g *BlameGenerator) loadNewFile() error {
@@ -36,8 +36,11 @@ func (g *BlameGenerator) loadNewFile() error {
3636

3737
result, err := git.Blame(g.commit, g.curFile.Name)
3838
if err != nil {
39-
msg := fmt.Sprintf("Error in BLAME for file %s: %s",
40-
g.curFile.Name, err.Error())
39+
msg := fmt.Sprintf(
40+
"Error in BLAME for file %s: %s",
41+
g.curFile.Name,
42+
err.Error(),
43+
)
4144
logrus.Warn(msg)
4245
g.ctx.Warn(0, msg)
4346
return io.EOF
@@ -153,7 +156,7 @@ func (b *Blame) Eval(ctx *sql.Context, row sql.Row) (interface{}, error) {
153156
return nil, err
154157
}
155158

156-
bg, err := NewBlameGenerator(commit, fIter, ctx)
159+
bg, err := NewBlameGenerator(ctx, commit, fIter)
157160
if err != nil {
158161
return nil, err
159162
}

0 commit comments

Comments
 (0)