From 8be1fd23482dd32504a8ec198beab65d70846c09 Mon Sep 17 00:00:00 2001 From: Arsen Musayelyan Date: Sun, 1 May 2022 01:50:20 -0700 Subject: [PATCH] Run gofmt and add badge to readme --- README.md | 2 ++ internal/reflectutil/utils.go | 4 ++-- internal/types/types.go | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index cde0302..6521a3d 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,7 @@ # lrpc +[![Go Reference](https://pkg.go.dev/badge/go.arsenm.dev/lrpc.svg)](https://pkg.go.dev/go.arsenm.dev/lrpc) + A lightweight RPC framework that aims to be as easy to use as possible, while also being as lightweight as possible. Most current RPC frameworks are bloated to the point of adding 7MB to my binary, like RPCX. That is what prompted me to create this. --- diff --git a/internal/reflectutil/utils.go b/internal/reflectutil/utils.go index 8d1d3d8..a4825b0 100644 --- a/internal/reflectutil/utils.go +++ b/internal/reflectutil/utils.go @@ -71,8 +71,8 @@ func Convert(in reflect.Value, toType reflect.Type) (reflect.Value, error) { // If input is a slice of any, and output is an array or slice if in.Type() == reflect.TypeOf([]any{}) && to.Kind() == reflect.Slice || to.Kind() == reflect.Array { - // Use ConvertSlice to convert value - to.Set(reflect.ValueOf(ConvertSlice( + // Use ConvertSlice to convert value + to.Set(reflect.ValueOf(ConvertSlice( in.Interface().([]any), toType, ))) diff --git a/internal/types/types.go b/internal/types/types.go index 7904e82..6ce5e51 100644 --- a/internal/types/types.go +++ b/internal/types/types.go @@ -12,7 +12,7 @@ type Request struct { type Response struct { ID string IsChannel bool - IsError bool + IsError bool Error string Return any }