格式化注释

This commit is contained in:
Liang Ding 2014-10-08 13:54:16 +08:00
parent 42f3c71b14
commit 5b1a62ee63
4 changed files with 10 additions and 9 deletions

View File

@ -343,8 +343,8 @@ func getEditorMode(filenameExtension string) string {
//
// fileType:
//
// "f": 文件
// "d": 目录
// "f": 文件
// "d": 目录
func createFile(path, fileType string) bool {
switch fileType {
case "f":

View File

@ -222,8 +222,8 @@ func main() {
//
// 共性处理:
//
// 1. panic recover
// 2. 请求计时
// 1. panic recover
// 2. 请求计时
func handlerWrapper(f func(w http.ResponseWriter, r *http.Request)) func(w http.ResponseWriter, r *http.Request) {
handler := panicRecover(f)
handler = stopwatch(handler)

View File

@ -2,8 +2,8 @@
//
// Wide 服务器端需要维护两种会话:
//
// 1. HTTP 会话:主要用于验证登录
// 2. Wide 会话:浏览器 tab 打开/刷新会创建一个,并和 HTTP 会话进行关联
// 1. HTTP 会话:主要用于验证登录
// 2. Wide 会话:浏览器 tab 打开/刷新会创建一个,并和 HTTP 会话进行关联
//
// 当会话失效时:释放所有和该会话相关的资源,例如运行中的程序进程、事件队列等.
package session
@ -226,9 +226,9 @@ func (sessions *Sessions) Get(sid string) *WideSession {
//
// 会话相关资源:
//
// 1. 用户事件队列
// 2. 运行中的进程集
// 3. WebSocket 通道
// 1. 用户事件队列
// 2. 运行中的进程集
// 3. WebSocket 通道
func (sessions *Sessions) Remove(sid string) {
mutex.Lock()
defer mutex.Unlock()

View File

@ -127,6 +127,7 @@ func WSHandler(w http.ResponseWriter, r *http.Request) {
}
}
// 以管道方式执行多个命令.
func pipeCommands(username string, commands ...*exec.Cmd) string {
for i, command := range commands[:len(commands)-1] {
setCmdEnv(command, username)