cerca

lean forum software (pmc local branch)
Log | Files | Refs | README | LICENSE

commit c4bf9831333903b733f9d89fbf3fe68336edba0d
parent 946d49d1cee65e1c1b5692535c7e12582dc2c6e8
Author: cblgh <cblgh@cblgh.org>
Date:   Sun, 18 Sep 2022 16:11:04 +0200

simplify

Diffstat:
Mserver/server.go | 6++----
1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/server/server.go b/server/server.go @@ -669,6 +669,7 @@ func (h RequestHandler) DeletePostRoute(res http.ResponseWriter, req *http.Reque func Serve(allowlist []string, sessionKey string, isdev bool) { port := ":8272" dir := "./data/" + if isdev { developing = true dir = "./testdata/" @@ -715,10 +716,7 @@ func (u *CercaForum) directory() string { func NewServer(allowlist []string, sessionKey, dir string) (*CercaForum, error) { s := &CercaForum{ ServeMux: http.ServeMux{}, - } - - if dir != "" { - s.Directory = dir + Directory: dir, } dbpath := filepath.Join(s.directory(), "forum.db")