Skip to content

Commit

Permalink
fix: lint error
Browse files Browse the repository at this point in the history
  • Loading branch information
kongfei605 committed Sep 29, 2024
1 parent 2d9e94b commit ccdbfbc
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion inputs/apache/apache.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ func (ins *Instance) Init() error {
e, err := exporter.New(logger, &ins.Config)

if err != nil {
return fmt.Errorf("could not instantiate mongodb lag exporter: %w", err)
return fmt.Errorf("could not instantiate mongodb lag exporter: %v", err)
}

ins.e = e
Expand Down
5 changes: 3 additions & 2 deletions inputs/mtail/internal/runtime/compiler/errors/errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@ import (
"fmt"
"strings"

"flashcat.cloud/categraf/inputs/mtail/internal/runtime/compiler/position"
"github.com/pkg/errors"

"flashcat.cloud/categraf/inputs/mtail/internal/runtime/compiler/position"
)

type compileError struct {
Expand All @@ -26,7 +27,7 @@ type ErrorList []*compileError
// Add appends an error at a position to the list of errors.
func (p *ErrorList) Add(pos *position.Position, msg string) {
if pos == nil {
pos = &position.Position{"", -1, -1, -1}
pos = &position.Position{Filename: "", Line: -1, Startcol: -1, Endcol: -1}
}
*p = append(*p, &compileError{*pos, msg})
}
Expand Down
2 changes: 1 addition & 1 deletion inputs/mtail/internal/tailer/logstream/filestream.go
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ func (fs *fileStream) stream(ctx context.Context, wg *sync.WaitGroup, waker wake
// common change pattern anyway.
newfi, serr := os.Stat(fs.pathname)
if serr != nil {
log.Printf("stream(%s): stat error: %v", serr)
log.Printf("stream(%s): stat error: %v", fs.pathname, serr)
// If this is a NotExist error, then we should wrap up this
// goroutine. The Tailer will create a new logstream if the
// file is in the middle of a rotation and gets recreated
Expand Down
2 changes: 1 addition & 1 deletion inputs/mtail/internal/tailer/logstream/logstream.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ func New(ctx context.Context, wg *sync.WaitGroup, waker waker.Waker, pathname st
if err != nil {
return nil, err
}
log.Println("Parsed url as %v", u)
log.Printf("Parsed url as %v", u)

path := pathname
switch u.Scheme {
Expand Down

0 comments on commit ccdbfbc

Please sign in to comment.