mirror of
https://github.com/TECHNOFAB11/zfs-localpv.git
synced 2025-12-12 14:30:12 +01:00
feat(zfspv) Add golint check to travis (#175)
Signed-off-by: vaniisgh <vanisingh@live.co.uk>
This commit is contained in:
parent
8b7ad5cb45
commit
8bbf3d7d2f
34 changed files with 321 additions and 266 deletions
|
|
@ -21,20 +21,20 @@ import (
|
|||
)
|
||||
|
||||
// ListBuilder enables building an instance of
|
||||
// Podlist
|
||||
// List
|
||||
type ListBuilder struct {
|
||||
list *PodList
|
||||
list *List
|
||||
filters predicateList
|
||||
}
|
||||
|
||||
// NewListBuilder returns a instance of ListBuilder
|
||||
func NewListBuilder() *ListBuilder {
|
||||
return &ListBuilder{list: &PodList{items: []*Pod{}}}
|
||||
return &ListBuilder{list: &List{items: []*Pod{}}}
|
||||
}
|
||||
|
||||
// ListBuilderForAPIList returns a instance of ListBuilder from API PodList
|
||||
// ListBuilderForAPIList returns a instance of ListBuilder from API List
|
||||
func ListBuilderForAPIList(pods *corev1.PodList) *ListBuilder {
|
||||
b := &ListBuilder{list: &PodList{}}
|
||||
b := &ListBuilder{list: &List{}}
|
||||
if pods == nil {
|
||||
return b
|
||||
}
|
||||
|
|
@ -47,7 +47,7 @@ func ListBuilderForAPIList(pods *corev1.PodList) *ListBuilder {
|
|||
|
||||
// ListBuilderForObjectList returns a instance of ListBuilder from API Pods
|
||||
func ListBuilderForObjectList(pods ...*Pod) *ListBuilder {
|
||||
b := &ListBuilder{list: &PodList{}}
|
||||
b := &ListBuilder{list: &List{}}
|
||||
if pods == nil {
|
||||
return b
|
||||
}
|
||||
|
|
@ -61,11 +61,11 @@ func ListBuilderForObjectList(pods ...*Pod) *ListBuilder {
|
|||
// List returns the list of pod
|
||||
// instances that was built by this
|
||||
// builder
|
||||
func (b *ListBuilder) List() *PodList {
|
||||
func (b *ListBuilder) List() *List {
|
||||
if b.filters == nil || len(b.filters) == 0 {
|
||||
return b.list
|
||||
}
|
||||
filtered := &PodList{}
|
||||
filtered := &List{}
|
||||
for _, pod := range b.list.items {
|
||||
if b.filters.all(pod) {
|
||||
filtered.items = append(filtered.items, pod)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue