From 3714f15bf29cfb79c3623784e391a7a4854f6815 Mon Sep 17 00:00:00 2001 From: Shulhan Date: Sat, 7 Feb 2026 16:03:19 +0700 Subject: 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. --- server_test.go | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'server_test.go') 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) } -- cgit v1.3