syntax fixes
This commit is contained in:
parent
8e748aaa90
commit
1ce33aa89a
13 changed files with 45 additions and 43 deletions
|
|
@ -246,7 +246,7 @@ func (c *Context) LogSetCookie(msg string, err error) {
|
|||
c.SetCookie(nil, 0)
|
||||
}
|
||||
|
||||
func (c *Context) Login(u core.User, remember string) {
|
||||
func (c *Context) Login(u *core.User, remember string) {
|
||||
var d time.Duration
|
||||
if remember != "" {
|
||||
d = day * 7
|
||||
|
|
|
|||
|
|
@ -465,10 +465,8 @@ func pageHandler(ctx *Context) {
|
|||
if ctx.T == nil {
|
||||
ctx.Template("pageViewHandler")
|
||||
}
|
||||
} else {
|
||||
if ctx.T == nil {
|
||||
ctx.Template("pageHandler")
|
||||
}
|
||||
} else if ctx.T == nil {
|
||||
ctx.Template("pageHandler")
|
||||
}
|
||||
page, err := ctx.Srv.DB.GetPage(section, title, user)
|
||||
if err != nil {
|
||||
|
|
@ -866,8 +864,7 @@ func statsHandler(ctx *Context) {
|
|||
Title: "Stats",
|
||||
BodyTitle: "Stats",
|
||||
}
|
||||
switch ctx.Method() {
|
||||
case "GET":
|
||||
if ctx.Method() == "GET" {
|
||||
ctx.Data.Data = getStats(ctx.Srv.DB.Index)
|
||||
ctx.Exec()
|
||||
}
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ const (
|
|||
)
|
||||
|
||||
type HTTPServer struct {
|
||||
Config core.Config
|
||||
Config *core.Config
|
||||
|
||||
listener net.Listener
|
||||
srv *http.Server
|
||||
|
|
@ -36,7 +36,7 @@ type HTTPServer struct {
|
|||
res map[string][]byte
|
||||
}
|
||||
|
||||
func NewHTTPServer(cfg core.Config, l net.Listener) (srv *HTTPServer) {
|
||||
func NewHTTPServer(cfg *core.Config, l net.Listener) (srv *HTTPServer) {
|
||||
srv = &HTTPServer{
|
||||
Config: cfg,
|
||||
listener: l,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue