From a5ee2458ecb2cc470fe4624c32282c7600b13370 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vin=C3=ADcius=20Garcia?= Date: Mon, 14 Sep 2020 15:55:54 -0300 Subject: [PATCH] Fix lint problems --- kiss_orm.go | 1 + slices/slices.go | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/kiss_orm.go b/kiss_orm.go index 4bb1b46..12e8bf3 100644 --- a/kiss_orm.go +++ b/kiss_orm.go @@ -46,6 +46,7 @@ func (c Client) Find( return it.Error } +// GetByID recovers a single entity from the database by the ID field. func (c Client) GetByID( ctx context.Context, item interface{}, diff --git a/slices/slices.go b/slices/slices.go index 583384e..65399c1 100644 --- a/slices/slices.go +++ b/slices/slices.go @@ -2,10 +2,15 @@ package slices import "reflect" +// ToInterfaceSlicer describes objects that +// can be converted to a list of interfaces type ToInterfaceSlicer interface { ToInterfaceSlice() []interface{} } +// ToInterfaceSlice converts any slice into a slice of empty interfaces. +// +// If the input argument is not a slice it panics. func ToInterfaceSlice(slice interface{}) (resp []interface{}) { if iSlicer, ok := slice.(ToInterfaceSlicer); ok { return iSlicer.ToInterfaceSlice()