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. --- finger/client.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'finger/client.go') diff --git a/finger/client.go b/finger/client.go index 8ebf3ca..75a382f 100644 --- a/finger/client.go +++ b/finger/client.go @@ -7,7 +7,7 @@ import ( "net" "strings" - sr "tildegit.org/tjp/sliderule" + "tildegit.org/tjp/sliderule/internal/types" ) // Client is used for sending finger requests and reading responses. @@ -18,7 +18,7 @@ import ( type Client struct{} // RoundTrip sends a single finger request and returns its response. -func (c Client) RoundTrip(request *sr.Request) (*sr.Response, error) { +func (c Client) RoundTrip(request *types.Request) (*types.Response, error) { if request.Scheme != "finger" && request.Scheme != "" { return nil, errors.New("non-finger protocols not supported") } @@ -46,11 +46,11 @@ func (c Client) RoundTrip(request *sr.Request) (*sr.Response, error) { return nil, err } - return &sr.Response{Body: bytes.NewBuffer(response)}, nil + return &types.Response{Body: bytes.NewBuffer(response)}, nil } // Fetch resolves a finger query. -func (c Client) Fetch(query string) (*sr.Response, error) { +func (c Client) Fetch(query string) (*types.Response, error) { req, err := ParseRequest(bytes.NewBufferString(query + "\r\n")) if err != nil { return nil, err -- cgit v1.2.3