chore(go-lint): fix golint warning (#133)

Fixes several go lint cases reported by go report. 

Signed-off-by: wiwen <shenggxhz@gmail.com>
This commit is contained in:
wiwen 2020-06-09 17:17:23 +08:00 committed by GitHub
parent 639ead416e
commit f5ae3ff476
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
25 changed files with 78 additions and 51 deletions

View file

@ -101,6 +101,8 @@ func (b *Builder) WithLabels(labels map[string]string) *Builder {
return b
}
// WithFinalizer merge existing finalizers if any
// with the ones that are provided here
func (b *Builder) WithFinalizer(finalizer []string) *Builder {
b.snap.Object.Finalizers = append(b.snap.Object.Finalizers, finalizer...)
return b

View file

@ -178,6 +178,7 @@ func (b *Builder) WithSnapshot(snap string) *Builder {
return b
}
// WithPoolName sets Pool name for creating volume
func (b *Builder) WithPoolName(pool string) *Builder {
if pool == "" {
b.errs = append(
@ -192,7 +193,8 @@ func (b *Builder) WithPoolName(pool string) *Builder {
return b
}
func (b *Builder) WithNodename(name string) *Builder {
// WithNodeName sets NodeID for creating the volume
func (b *Builder) WithNodeName(name string) *Builder {
if name == "" {
b.errs = append(
b.errs,
@ -223,6 +225,7 @@ func (b *Builder) WithLabels(labels map[string]string) *Builder {
return b
}
// WithFinalizer sets Finalizer name creating the volume
func (b *Builder) WithFinalizer(finalizer []string) *Builder {
b.volume.Object.Finalizers = append(b.volume.Object.Finalizers, finalizer...)
return b