Merge pull request #10 from jlatt/cleanup

cleanup
This commit is contained in:
Jeremy Latt
2014-03-02 11:37:06 -08:00
6 changed files with 79 additions and 51 deletions
+1 -7
View File
@@ -7,7 +7,6 @@ import (
"database/sql"
"encoding/binary"
"fmt"
_ "github.com/mattn/go-sqlite3"
"log"
"net"
"os"
@@ -37,17 +36,12 @@ type Server struct {
}
func NewServer(config *Config) *Server {
db, err := sql.Open("sqlite3", config.Database())
if err != nil {
log.Fatal(err)
}
server := &Server{
channels: make(ChannelNameMap),
clients: make(ClientNameMap),
commands: make(chan Command, 16),
ctime: time.Now(),
db: db,
db: OpenDB(config.Database()),
idle: make(chan *Client, 16),
motdFile: config.MOTD,
name: config.Name,