From f3c538a86a9948601a225387b163cca1118714dc Mon Sep 17 00:00:00 2001 From: Xiangyu Wang Date: Mon, 4 Oct 2021 23:44:26 +0800 Subject: [PATCH] [skip ci]Fix golint warnings in errors (#9237) Signed-off-by: Xiangyu Wang --- internal/util/milvuserrors/errors.go | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/internal/util/milvuserrors/errors.go b/internal/util/milvuserrors/errors.go index 705260cba4..114fd02c5a 100644 --- a/internal/util/milvuserrors/errors.go +++ b/internal/util/milvuserrors/errors.go @@ -17,40 +17,52 @@ import ( ) const ( - MsgRootCoordNotServing = "root coordinator is not serving" + // MsgRootCoordNotServing means that root coordinator not serving + MsgRootCoordNotServing = "root coordinator is not serving" + // MsgQueryCoordNotServing means that query coordinator not serving MsgQueryCoordNotServing = "query coordinator is not serving" - MsgDataCoordNotServing = "data coordinator is not serving" + // MsgDataCoordNotServing means that data coordinator not serving + MsgDataCoordNotServing = "data coordinator is not serving" + // MsgIndexCoordNotServing means that index coordinator not serving MsgIndexCoordNotServing = "index coordinator is not serving" ) +// MsgCollectionAlreadyExist is used to construct an error message of collection already exist func MsgCollectionAlreadyExist(name string) string { return fmt.Sprintf("Collection %s already exist", name) } +// ErrCollectionAlreadyExist is used to construct an error of collection already exist func ErrCollectionAlreadyExist(name string) error { return errors.New(MsgCollectionAlreadyExist(name)) } +// MsgCollectionNotExist is used to construct an error message of collection not exist func MsgCollectionNotExist(name string) string { return fmt.Sprintf("Collection %s not exist", name) } +// ErrCollectionNotExist is used to construct an error of collection not exist func ErrCollectionNotExist(name string) error { return errors.New(MsgCollectionNotExist(name)) } +// MsgPartitionAlreadyExist is used to construct an error message of partition already exist func MsgPartitionAlreadyExist(name string) string { return fmt.Sprintf("Partition %s already exist", name) } +// ErrPartitionAlreadyExist is used to construct an error of partition already exist func ErrPartitionAlreadyExist(name string) error { return errors.New(MsgPartitionAlreadyExist(name)) } +// MsgPartitionNotExist is used to construct an error message of partition not exist func MsgPartitionNotExist(name string) string { return fmt.Sprintf("Partition %s not exist", name) } +// ErrPartitionNotExist is used to construct an error of partition not exist func ErrPartitionNotExist(name string) error { return errors.New(MsgPartitionNotExist(name)) }