[skip ci]Fix golint warnings in errors (#9237)

Signed-off-by: Xiangyu Wang <xiangyu.wang@zilliz.com>
pull/9241/head
Xiangyu Wang 2021-10-04 23:44:26 +08:00 committed by GitHub
parent 0c899deb50
commit f3c538a86a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 14 additions and 2 deletions

View File

@ -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))
}