Removed capitalization in error message

*  This commit removed capitalization in error message
   Error string should not be capitalized:
   https://github.com/golang/go/wiki/CodeReviewComments#error-strings
* Also, fixed some typos

Signed-off-by: bijayasharma <vetbijaya@gmail.com>
Change-Id: I01e9a0753ff0f2c18607ea3c5b9a3c3e9698f045
This commit is contained in:
bijayasharma 2021-12-01 16:06:54 -05:00 committed by Bijaya Sharma
parent 9589692d26
commit bdeafa77b6
5 changed files with 7 additions and 7 deletions

View File

@ -47,7 +47,7 @@ type CommandOptions struct {
Inventory ifc.Inventory Inventory ifc.Inventory
} }
// ListHostsCommand is used to store common variables from cmd flags for list-hots command // ListHostsCommand is used to store common variables from cmd flags for list-hosts command
type ListHostsCommand struct { type ListHostsCommand struct {
Writer io.Writer Writer io.Writer
Options *CommandOptions Options *CommandOptions
@ -83,7 +83,7 @@ func (o *CommandOptions) validateSingleHostAction() error {
return nil return nil
} }
//RunE method returns list of hots from BaremetalInventory //RunE method returns list of hosts from BaremetalInventory
func (l *ListHostsCommand) RunE() error { func (l *ListHostsCommand) RunE() error {
if l.OutputFormat != TableOutputFormat && l.OutputFormat != YamlOutputFormat { if l.OutputFormat != TableOutputFormat && l.OutputFormat != YamlOutputFormat {
return ErrInvalidOptions{Message: "output formats. Supported options are 'table' and 'yaml'"} return ErrInvalidOptions{Message: "output formats. Supported options are 'table' and 'yaml'"}
@ -94,7 +94,7 @@ func (l *ListHostsCommand) RunE() error {
return err return err
} }
if len(hostClients) == 0 { if len(hostClients) == 0 {
return fmt.Errorf("No hosts present in the hostInventory") return fmt.Errorf("no hosts present in the hostInventory")
} }
return l.Write(hostClients) return l.Write(hostClients)
} }

View File

@ -68,7 +68,7 @@ func TestListHostsCommand(t *testing.T) {
}) })
t.Run("error ListHosts", func(t *testing.T) { t.Run("error ListHosts", func(t *testing.T) {
expectedErr := fmt.Errorf("No hosts present in the hostInventory") expectedErr := fmt.Errorf("no hosts present in the hostInventory")
var hosts []remoteifc.Client var hosts []remoteifc.Client
bmhInv := &mockinventory.MockBMHInventory{} bmhInv := &mockinventory.MockBMHInventory{}

View File

@ -16,7 +16,7 @@ package inventory
import "fmt" import "fmt"
// ErrInvalidOptions is returned when incompetible flags are // ErrInvalidOptions is returned when incompatible flags are
type ErrInvalidOptions struct { type ErrInvalidOptions struct {
Message string Message string
} }

View File

@ -49,6 +49,6 @@ const (
) )
// BaremetalBatchRunOptions are options to be passed to RunOperation, this is to be // BaremetalBatchRunOptions are options to be passed to RunOperation, this is to be
// exetended in the future, to support such things as concurency // extended in the future, to support such things as concurency
type BaremetalBatchRunOptions struct { type BaremetalBatchRunOptions struct {
} }

View File

@ -15,7 +15,7 @@
package ifc package ifc
// BaremetalHostSelector allows to select baremetal hosts, if used empty all possible hosts // BaremetalHostSelector allows to select baremetal hosts, if used empty all possible hosts
// will be should be returned by Select() method of BaremetalInvenotry interface // will be should be returned by Select() method of BaremetalInventory interface
type BaremetalHostSelector struct { type BaremetalHostSelector struct {
Name string Name string
Namespace string Namespace string