mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-06-18 19:59:45 +00:00
Move tool as part of static checks migration. Fixes #8187 Signed-off-by: Chelsea Mafrica <chelsea.e.mafrica@intel.com> Signed-off-by: Derek Lee <derlee@redhat.com> Signed-off-by: Gabriela Cervantes <gabriela.cervantes.tellez@intel.com> Signed-off-by: Graham Whaley <graham.whaley@intel.com> Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com> Signed-off-by: Marco Vedovati <mvedovati@suse.com> Signed-off-by: Peng Tao <bergwolf@hyper.sh> Signed-off-by: Shiming Zhang <wzshiming@foxmail.com> Signed-off-by: Snir Sheriber <ssheribe@redhat.com> Signed-off-by: Wainer dos Santos Moschetta <wainersm@redhat.com>
25 lines
436 B
Go
25 lines
436 B
Go
// Copyright (c) 2019 Intel Corporation
|
|
//
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
//
|
|
|
|
package main
|
|
|
|
import "errors"
|
|
|
|
func getLabelsByCategory(categoryName string, lf *LabelsFile) ([]Label, error) {
|
|
var labels []Label
|
|
|
|
if categoryName == "" {
|
|
return nil, errors.New("need category name")
|
|
}
|
|
|
|
for _, label := range lf.Labels {
|
|
if label.CategoryName == categoryName {
|
|
labels = append(labels, label)
|
|
}
|
|
}
|
|
|
|
return labels, nil
|
|
}
|