aboutsummaryrefslogtreecommitdiff
path: root/server_test.go
diff options
context:
space:
mode:
authorShulhan <ms@kilabit.info>2026-02-07 16:03:19 +0700
committerShulhan <ms@kilabit.info>2026-02-07 16:03:19 +0700
commit3714f15bf29cfb79c3623784e391a7a4854f6815 (patch)
tree09913bd02652a11dd1b894c0e2093f78f522548c /server_test.go
parent759c9b8e542d2ce159228e35c6d4138fbaef25de (diff)
downloadciigo-3714f15bf29cfb79c3623784e391a7a4854f6815.tar.xz
all: embed struct [lib/http.ServerOptions] directly to [ServeOptions]
At this point, all of the fields in the struct ServeOptions is the same with [lib/http.ServerOptions] except IsDevelopment and ConvertOptions. For field IsDevelopment we keep in the struct. For field ConvertOptions we remove it and let the caller pass it on Serve function or InitHTTPServer method.
Diffstat (limited to 'server_test.go')
-rw-r--r--server_test.go16
1 files changed, 10 insertions, 6 deletions
diff --git a/server_test.go b/server_test.go
index fab2e4f..06b3edf 100644
--- a/server_test.go
+++ b/server_test.go
@@ -11,6 +11,7 @@ import (
"testing"
"git.sr.ht/~shulhan/ciigo"
+ libhttp "git.sr.ht/~shulhan/pakakeh.go/lib/http"
"git.sr.ht/~shulhan/pakakeh.go/lib/test"
"git.sr.ht/~shulhan/pakakeh.go/lib/test/httptest"
)
@@ -37,14 +38,17 @@ func TestCiigoOnGet(t *testing.T) {
var cigo = ciigo.Ciigo{}
- var serveOpts = ciigo.ServeOptions{
- Address: `127.0.0.1:11083`,
- ConvertOptions: ciigo.ConvertOptions{
- Root: dirRoot,
- HTMLTemplate: `testdata/onGet_template.gohtml`,
+ serveOpts := ciigo.ServeOptions{
+ ServerOptions: libhttp.ServerOptions{
+ Address: `127.0.0.1:11083`,
},
}
- err = cigo.InitHTTPServer(serveOpts)
+ convertOpts := ciigo.ConvertOptions{
+ Root: dirRoot,
+ HTMLTemplate: `testdata/onGet_template.gohtml`,
+ }
+
+ err = cigo.InitHTTPServer(serveOpts, convertOpts)
if err != nil {
t.Fatal(err)
}