Skip to content

Commit

Permalink
Fix linting issue
Browse files Browse the repository at this point in the history
Signed-off-by: Gabriel Adrian Samfira <[email protected]>
  • Loading branch information
gabriel-samfira committed Oct 17, 2023
1 parent 2f3bda8 commit 2585dd9
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions solver/llbsolver/file/backend.go
Original file line number Diff line number Diff line change
Expand Up @@ -212,22 +212,22 @@ func docopy(ctx context.Context, src, dest string, action pb.FileActionCopy, u *

// NewFileOpBackend returns a new file operation backend. The executor is currently only used for Windows,
// and it is used to construct the readUserFn field set in the returned Backend.
func NewFileOpBackend(readUser ReadUserCallback) (*backend, error) {
func NewFileOpBackend(readUser ReadUserCallback) (*Backend, error) {
if readUser == nil {
return nil, errors.New("readUser callback must be provided")
}
return &backend{
return &Backend{
readUser: readUser,
}, nil
}

type ReadUserCallback func(chopt *pb.ChownOpt, mu, mg snapshot.Mountable) (*copy.User, error)

type backend struct {
type Backend struct {
readUser ReadUserCallback
}

func (fb *backend) Mkdir(ctx context.Context, m, user, group fileoptypes.Mount, action pb.FileActionMkDir) error {
func (fb *Backend) Mkdir(ctx context.Context, m, user, group fileoptypes.Mount, action pb.FileActionMkDir) error {
mnt, ok := m.(*Mount)
if !ok {
return errors.Errorf("invalid mount type %T", m)
Expand All @@ -248,7 +248,7 @@ func (fb *backend) Mkdir(ctx context.Context, m, user, group fileoptypes.Mount,
return mkdir(ctx, dir, action, u, mnt.m.IdentityMapping())
}

func (fb *backend) Mkfile(ctx context.Context, m, user, group fileoptypes.Mount, action pb.FileActionMkFile) error {
func (fb *Backend) Mkfile(ctx context.Context, m, user, group fileoptypes.Mount, action pb.FileActionMkFile) error {
mnt, ok := m.(*Mount)
if !ok {
return errors.Errorf("invalid mount type %T", m)
Expand All @@ -269,7 +269,7 @@ func (fb *backend) Mkfile(ctx context.Context, m, user, group fileoptypes.Mount,
return mkfile(ctx, dir, action, u, mnt.m.IdentityMapping())
}

func (fb *backend) Rm(ctx context.Context, m fileoptypes.Mount, action pb.FileActionRm) error {
func (fb *Backend) Rm(ctx context.Context, m fileoptypes.Mount, action pb.FileActionRm) error {
mnt, ok := m.(*Mount)
if !ok {
return errors.Errorf("invalid mount type %T", m)
Expand All @@ -285,7 +285,7 @@ func (fb *backend) Rm(ctx context.Context, m fileoptypes.Mount, action pb.FileAc
return rm(ctx, dir, action)
}

func (fb *backend) Copy(ctx context.Context, m1, m2, user, group fileoptypes.Mount, action pb.FileActionCopy) error {
func (fb *Backend) Copy(ctx context.Context, m1, m2, user, group fileoptypes.Mount, action pb.FileActionCopy) error {
mnt1, ok := m1.(*Mount)
if !ok {
return errors.Errorf("invalid mount type %T", m1)
Expand Down Expand Up @@ -317,7 +317,7 @@ func (fb *backend) Copy(ctx context.Context, m1, m2, user, group fileoptypes.Mou
return docopy(ctx, src, dest, action, u, mnt2.m.IdentityMapping())
}

func (fb *backend) readUserWrapper(owner *pb.ChownOpt, user, group fileoptypes.Mount) (*copy.User, error) {
func (fb *Backend) readUserWrapper(owner *pb.ChownOpt, user, group fileoptypes.Mount) (*copy.User, error) {
var userMountable, groupMountable snapshot.Mountable
if user != nil {
usr, ok := user.(*Mount)
Expand Down

0 comments on commit 2585dd9

Please sign in to comment.