File tree 1 file changed +4
-5
lines changed
1 file changed +4
-5
lines changed Original file line number Diff line number Diff line change @@ -45,19 +45,18 @@ func (lf *LocalStore) Init(ctx context.Context, f *file.FileConfig) error {
45
45
return nil
46
46
}
47
47
func (lf * LocalStore ) Put (ctx context.Context , f * file.PutFileStu ) error {
48
- if _ , ok := f .Metadata [FileMode ]; ! ok {
48
+ mode , ok := f .Metadata [FileMode ]
49
+ if ! ok {
49
50
return fmt .Errorf ("fileMode is required for put file" )
50
51
}
51
- if _ , ok := f .Metadata [FileFlag ]; ! ok {
52
+ flag , ok := f .Metadata [FileFlag ]
53
+ if ! ok {
52
54
return fmt .Errorf ("fileFlag is required for put file" )
53
55
}
54
- mode := f .Metadata [FileMode ]
55
56
m , err := strconv .Atoi (mode )
56
57
if err != nil {
57
58
return fmt .Errorf ("wrong fileMode value:%+v in metadata" , err )
58
59
}
59
-
60
- flag := f .Metadata [FileFlag ]
61
60
fl , err := strconv .Atoi (flag )
62
61
if err != nil {
63
62
return fmt .Errorf ("wrong fileFlag value:%+v in metadata" , err )
You can’t perform that action at this time.
0 commit comments