From 23bc5f4fb7542e64c94eaa7fe2c7a6aa55010898 Mon Sep 17 00:00:00 2001 From: tjpcc Date: Sat, 12 Aug 2023 09:40:39 -0600 Subject: move common types to an internal package This helps avoid import cycles. --- gemini/roundtrip_test.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'gemini/roundtrip_test.go') diff --git a/gemini/roundtrip_test.go b/gemini/roundtrip_test.go index 0aa5648..50c1962 100644 --- a/gemini/roundtrip_test.go +++ b/gemini/roundtrip_test.go @@ -12,7 +12,7 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - sr "tildegit.org/tjp/sliderule" + "tildegit.org/tjp/sliderule/internal/types" "tildegit.org/tjp/sliderule/gemini" ) @@ -20,7 +20,7 @@ func TestRoundTrip(t *testing.T) { tlsConf, err := gemini.FileTLS("./testdata/server.crt", "./testdata/server.key") require.Nil(t, err) - handler := sr.HandlerFunc(func(ctx context.Context, req *sr.Request) *sr.Response { + handler := types.HandlerFunc(func(ctx context.Context, req *types.Request) *types.Response { return gemini.Success("text/gemini", bytes.NewBufferString("you've found my page")) }) @@ -36,7 +36,7 @@ func TestRoundTrip(t *testing.T) { require.Nil(t, err) cli := gemini.NewClient(testClientTLS()) - response, err := cli.RoundTrip(&sr.Request{URL: u}) + response, err := cli.RoundTrip(&types.Request{URL: u}) require.Nil(t, err) assert.Equal(t, gemini.StatusSuccess, response.Status) @@ -54,7 +54,7 @@ func TestTitanRequest(t *testing.T) { require.Nil(t, err) invoked := false - handler := sr.HandlerFunc(func(ctx context.Context, request *sr.Request) *sr.Response { + handler := types.HandlerFunc(func(ctx context.Context, request *types.Request) *types.Response { invoked = true body := gemini.GetTitanRequestBody(request) -- cgit v1.2.3