Skip to content

Commit

Permalink
fix: non-constant format string in call to ...
Browse files Browse the repository at this point in the history
Signed-off-by: Derek Su <derek.su@suse.com>
  • Loading branch information
derekbit committed Sep 7, 2024
1 parent fa26548 commit 23ad75b
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pkg/backup/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ func ResponseLogAndError(v interface{}) {
e, isErr := v.(error)
_, isRuntimeErr := e.(runtime.Error)
if isErr && !isRuntimeErr {
logrus.Errorf(fmt.Sprint(e))
logrus.Errorf("%v", e)
fmt.Println(fmt.Sprint(e))
} else {
logrus.Errorf("Caught FATAL error: %s", v)
Expand Down
2 changes: 1 addition & 1 deletion pkg/replica/diff_disk.go
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ func (d *diffDisk) lookup(sector int64) (byte, error) {
for i := len(d.files) - 1; i > 1; i-- {
e, errno := fibmap.Fiemap(d.files[i].Fd(), uint64(sector*d.sectorSize), uint64(d.sectorSize), 1)
if errno != 0 {
return 0, fmt.Errorf(errno.Error())
return 0, fmt.Errorf("%v", errno)
}
if len(e) > 0 {
d.location[sector] = byte(i)
Expand Down
2 changes: 1 addition & 1 deletion pkg/replica/rpc/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ func (rs *ReplicaServer) ReplicaExpand(ctx context.Context, req *enginerpc.Repli
errWithCode = types.NewError(types.ErrorCodeFunctionFailedWithoutRollback,
err.Error(), "")
}
return nil, status.Errorf(codes.Internal, errWithCode.ToJSONString())
return nil, status.Errorf(codes.Internal, "%s", errWithCode.ToJSONString())
}

return &enginerpc.ReplicaExpandResponse{Replica: rs.getReplica()}, nil
Expand Down

0 comments on commit 23ad75b

Please sign in to comment.