diff --git a/lib/crpc/server.go b/lib/crpc/server.go index ab5492b..4b7ada4 100644 --- a/lib/crpc/server.go +++ b/lib/crpc/server.go @@ -210,7 +210,7 @@ func checkResponseType(ctx context.Context, typ reflect.Type) error { case reflect.Ptr: elem := typ.Elem() - if elem.Kind() != reflect.Struct { + if elem.Kind() != reflect.Struct && elem.Kind() != reflect.String { err := checkResponseType(ctx, elem) if err != nil { return err diff --git a/lib/crpc/server_test.go b/lib/crpc/server_test.go index 76f986f..acfeffb 100644 --- a/lib/crpc/server_test.go +++ b/lib/crpc/server_test.go @@ -71,10 +71,6 @@ func TestWrap(t *testing.T) { "OutputNotPointer", func(ctx context.Context) (out testOutput, err error) { return }, "response_type_invalid", }, - { - "OutputNotStructSlice", func(ctx context.Context) (out *string, err error) { return }, - "response_type_invalid", - }, } for _, test := range tests {