File tree Expand file tree Collapse file tree 5 files changed +0
-21
lines changed Expand file tree Collapse file tree 5 files changed +0
-21
lines changed Original file line number Diff line number Diff line change @@ -81,13 +81,10 @@ func ToPerm(perm string) (p Perm) {
81
81
switch c {
82
82
case ReadPerm :
83
83
r = true
84
- break
85
84
case WritePerm :
86
85
w = true
87
- break
88
86
case ExecutePerm :
89
87
x = true
90
- break
91
88
default :
92
89
return p
93
90
}
Original file line number Diff line number Diff line change @@ -19,15 +19,13 @@ func Notify(shutdown func() error) {
19
19
err := shutdown ()
20
20
if err != nil {
21
21
log .Error (err , "shutdown error" )
22
- break
23
22
} else {
24
23
signal .Stop (c )
25
24
close (c )
26
25
return
27
26
}
28
27
default :
29
28
log .Debug ("received a signal [%s], ignore it" , s .String ())
30
- break
31
29
}
32
30
}
33
31
}
Original file line number Diff line number Diff line change @@ -232,16 +232,12 @@ func (m *remoteClientMonitor) parseMessage(data []byte) error {
232
232
switch status .ApiType {
233
233
case contract .AuthApi :
234
234
m .authChan <- status
235
- break
236
235
case contract .InfoApi :
237
236
m .infoChan <- contract .NewMessage (data )
238
- break
239
237
case contract .SyncMessageApi :
240
238
m .messages .PushBack (contract .NewMessage (data ))
241
- break
242
239
default :
243
240
log .Warn ("remote client monitor received a unknown data => %s" , string (data ))
244
- break
245
241
}
246
242
return nil
247
243
}
@@ -290,25 +286,20 @@ func (m *remoteClientMonitor) execSync(msg sync.Message) (err error) {
290
286
switch msg .Action {
291
287
case action .CreateAction :
292
288
err = m .syncer .Create (path )
293
- break
294
289
case action .WriteAction :
295
290
err = m .syncer .Create (path )
296
291
// ignore is not exist error
297
292
if err != nil && os .IsNotExist (err ) {
298
293
err = nil
299
294
}
300
295
m .addWrite (path )
301
- break
302
296
case action .RemoveAction :
303
297
m .removeWrite (path )
304
298
err = m .syncer .Remove (path )
305
- break
306
299
case action .RenameAction :
307
300
err = m .syncer .Rename (path )
308
- break
309
301
case action .ChmodAction :
310
302
err = m .syncer .Chmod (path )
311
- break
312
303
}
313
304
314
305
m .el .Write (eventlog .NewEvent (path , msg .Action .String ()))
Original file line number Diff line number Diff line change @@ -64,16 +64,12 @@ func (h *pushHandler) Handle(c *gin.Context) {
64
64
switch pushData .Action {
65
65
case action .CreateAction :
66
66
err = h .create (fi )
67
- break
68
67
case action .RemoveAction :
69
68
err = h .remove (fi )
70
- break
71
69
case action .RenameAction :
72
70
err = h .rename (fi )
73
- break
74
71
case action .ChmodAction :
75
72
err = h .chmod (fi )
76
- break
77
73
case action .WriteAction :
78
74
r , _ := h .write (pushData , c )
79
75
c .JSON (http .StatusOK , r )
Original file line number Diff line number Diff line change @@ -177,13 +177,10 @@ func (pcs *pushClientSync) receive() {
177
177
switch status .ApiType {
178
178
case contract .AuthApi :
179
179
pcs .authChan <- status
180
- break
181
180
case contract .InfoApi :
182
181
pcs .infoChan <- contract .NewMessage (data )
183
- break
184
182
default :
185
183
log .Warn ("[push client sync] receive and discard data => %s" , string (data ))
186
- break
187
184
}
188
185
}
189
186
}
You can’t perform that action at this time.
0 commit comments