We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7644c9f commit 23e9e68Copy full SHA for 23e9e68
gossa.go
@@ -231,11 +231,12 @@ func rpc(w http.ResponseWriter, r *http.Request) {
231
check(err)
232
json.Unmarshal(bodyBytes, &rpc)
233
234
- if rpc.Call == "mkdirp" {
+ switch rpc.Call {
235
+ case "mkdirp":
236
err = os.MkdirAll(enforcePath(rpc.Args[0]), os.ModePerm)
- } else if rpc.Call == "mv" {
237
+ case "mv":
238
err = os.Rename(enforcePath(rpc.Args[0]), enforcePath(rpc.Args[1]))
- } else if rpc.Call == "rm" {
239
+ case "rm":
240
err = os.RemoveAll(enforcePath(rpc.Args[0]))
241
}
242
0 commit comments