From e5470481f4de34aff0646b0d94a095db5eac6c2c Mon Sep 17 00:00:00 2001 From: Liang Ding Date: Mon, 22 Sep 2014 14:20:17 +0800 Subject: [PATCH] . --- file/files.go | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/file/files.go b/file/files.go index e6357bf..c5e643e 100644 --- a/file/files.go +++ b/file/files.go @@ -168,12 +168,14 @@ func NewFile(w http.ResponseWriter, r *http.Request) { fileType := args["fileType"].(string) if !createFile(path, fileType) { - if "f" == fileType { - extension := filepath.Ext(path) - data["mode"] = getEditorMode(extension) - - } data["succ"] = false + + return + } + + if "f" == fileType { + extension := filepath.Ext(path) + data["mode"] = getEditorMode(extension) } }