// Start starts the server.
Start starts the server.
// Start starts the server .
func (s *Server) Start() error {
	s.socketChannel = make(chan string)
	if s.FileUploadFunc == nil {
		var err error
		s.FileUploadFunc, err = saveTempFileFunc()
		if err != nil {
			return err
		}
	}
	if s.uploadableFlags == nil {
		s.uploadableFlags = make(map[string]struct{})
	}
	var funcMaps = template.FuncMap{
		"flagSetToSlice": flagSetToSlice,
		"notHelpCommand": notHelpCommand,
		"canUploadFile":  s.canUploadFile,
		"isStringSlice":  func(s string) bool { return s == "stringSlice" },
	}
	s.tCmd = template.Must(template.New("commands").Funcs(funcMaps).Parse(commandTpl))
	http.HandleFunc("/", s.handler)
	http.Handle("/ws", websocket.Handler(s.wsHandler))
	return http.ListenAndServe(s.ServerAddress, nil)
}
func ( s * Server ) Start ( ) error { s . socketChannel = make ( chan string ) if s . FileUploadFunc == nil { var err error s . FileUploadFunc , err = saveTempFileFunc ( ) if err != nil { return err } } if s . uploadableFlags == nil { s . uploadableFlags = make ( map [ string ] struct { } ) } var funcMaps = template . FuncMap { " " : flagSetToSlice , " " : notHelpCommand , " " : s . canUploadFile , " " : func ( s string ) bool { return s == " " } , } s . tCmd = template . Must ( template . New ( " " ) . Funcs ( funcMaps ) . Parse ( commandTpl ) ) http . HandleFunc ( " " , s . handler ) http . Handle ( " " , websocket . Handler ( s . wsHandler ) ) return http . ListenAndServe ( s . ServerAddress , nil ) }
Start starts the server.
Start starts the server .