From 5630a5abf79b1af7c4bfc6ccedf41bfc7d549608 Mon Sep 17 00:00:00 2001 From: Tim Smith Date: Fri, 5 Jul 2024 09:02:16 -0700 Subject: [PATCH] Spelling fixes Comments / variables Signed-off-by: Tim Smith --- mql/internal/nodes.go | 2 +- providers-sdk/v1/inventory/asset_url.go | 2 +- providers-sdk/v1/plugin/service.go | 2 +- providers-sdk/v1/plugin/service_test.go | 4 ++-- providers-sdk/v1/util/version/version.go | 2 +- providers/ansible/play/playbook_test.go | 2 +- providers/os/resources/machine.go | 2 +- providers/os/resources/smbios/linux.go | 2 +- providers/os/resources/smbios/smbios.go | 2 +- providers/os/resources/smbios/smbios_test.go | 6 +++--- providers/os/resources/updates/mac_updates.go | 2 +- providers/snowflake/connection/connection.go | 7 ++++--- providers/vsphere/connection/platform.go | 2 +- utils/multierr/errors.go | 2 +- 14 files changed, 20 insertions(+), 19 deletions(-) diff --git a/mql/internal/nodes.go b/mql/internal/nodes.go index 966f8a31fd..1044e879af 100644 --- a/mql/internal/nodes.go +++ b/mql/internal/nodes.go @@ -319,7 +319,7 @@ func (nodeData *CollectionFinisherNodeData) initialize() { } } -// consume marks the received dataponts as finished +// consume marks the received datapoints as finished func (nodeData *CollectionFinisherNodeData) consume(from NodeID, data *envelope) { if len(nodeData.remainingDatapoints) == 0 { return diff --git a/providers-sdk/v1/inventory/asset_url.go b/providers-sdk/v1/inventory/asset_url.go index 8ef8982c9a..e10793659e 100644 --- a/providers-sdk/v1/inventory/asset_url.go +++ b/providers-sdk/v1/inventory/asset_url.go @@ -18,7 +18,7 @@ import ( // group assets into hierarchical tree structures, that make it easy for us // to put them into a box and reason about them. // -// For example: A techology-centric view of the world would group a VM +// For example: A technology-centric view of the world would group a VM // in a cloud environment like this: // /aws/accountX/ec2/instances/linux/debian/8.0 // diff --git a/providers-sdk/v1/plugin/service.go b/providers-sdk/v1/plugin/service.go index 3dbd027f88..2d4cbad04c 100644 --- a/providers-sdk/v1/plugin/service.go +++ b/providers-sdk/v1/plugin/service.go @@ -34,7 +34,7 @@ func NewService() *Service { var heartbeatRes HeartbeatRes -// FIXME: once we move to v12, remove the conf parametrer and remove the connId from the createRuntime function. +// FIXME: once we move to v12, remove the conf parameter and remove the connId from the createRuntime function. // The connection ID will always be set before the connection call is done, so we don't need to do anything about it here. // The parameters are needed now, only to make sure that old clients can work with new providers. func (s *Service) AddRuntime(conf *inventory.Config, createRuntime func(connId uint32) (*Runtime, error)) (*Runtime, error) { diff --git a/providers-sdk/v1/plugin/service_test.go b/providers-sdk/v1/plugin/service_test.go index 9d2047e816..122465e357 100644 --- a/providers-sdk/v1/plugin/service_test.go +++ b/providers-sdk/v1/plugin/service_test.go @@ -80,7 +80,7 @@ func TestAddRuntime(t *testing.T) { // Wait until all runtimes are added wg.Wait() - // Vertify that all runtimes are added and the last connectiod ID is correct + // Verify that all runtimes are added and the last connection ID is correct assert.Len(t, s.runtimes, 200) assert.Equal(t, s.lastConnectionID, uint32(0)) } @@ -128,7 +128,7 @@ func TestDeprecatedAddRuntime(t *testing.T) { // Wait until all runtimes are added wg.Wait() - // Vertify that all runtimes are added and the last connectiod ID is correct + // Verify that all runtimes are added and the last connection ID is correct assert.Len(t, s.runtimes, 200) assert.Equal(t, s.lastConnectionID, uint32(200)) } diff --git a/providers-sdk/v1/util/version/version.go b/providers-sdk/v1/util/version/version.go index 86b21901d5..90863acb6d 100644 --- a/providers-sdk/v1/util/version/version.go +++ b/providers-sdk/v1/util/version/version.go @@ -490,7 +490,7 @@ func commitChanges(confs updateConfs) error { branchRef := plumbing.NewBranchReferenceName(branchName) // Note: The branch may be local and thus won't be found in repo.Branch(branchName) - // This is consufing and I couldn't find any further docs on this behavior, + // This is confusing and I couldn't find any further docs on this behavior, // but we have to work around it. if _, err := repo.Reference(branchRef, true); err == nil { err = repo.Storer.RemoveReference(branchRef) diff --git a/providers/ansible/play/playbook_test.go b/providers/ansible/play/playbook_test.go index 3312733a17..4d0f6283e8 100644 --- a/providers/ansible/play/playbook_test.go +++ b/providers/ansible/play/playbook_test.go @@ -76,7 +76,7 @@ func TestPlaybookDecoding(t *testing.T) { assert.Equal(t, "False", play.GatherFacts) }) - t.Run("load playbook with mulitple plays", func(t *testing.T) { + t.Run("load playbook with multiple plays", func(t *testing.T) { data, err := os.ReadFile("./testdata/play_multi.yml") require.NoError(t, err) diff --git a/providers/os/resources/machine.go b/providers/os/resources/machine.go index 3d08255661..4bcd036f37 100644 --- a/providers/os/resources/machine.go +++ b/providers/os/resources/machine.go @@ -83,7 +83,7 @@ func initMachineSystem(runtime *plugin.Runtime, args map[string]*llx.RawData) (m "serial": llx.StringData(biosInfo.SysInfo.SerialNumber), "uuid": llx.StringData(biosInfo.SysInfo.UUID), "sku": llx.StringData(biosInfo.SysInfo.SKU), - "family": llx.StringData(biosInfo.SysInfo.Familiy), + "family": llx.StringData(biosInfo.SysInfo.Family), }, nil, nil } diff --git a/providers/os/resources/smbios/linux.go b/providers/os/resources/smbios/linux.go index 5756f708c9..ab08fd0164 100644 --- a/providers/os/resources/smbios/linux.go +++ b/providers/os/resources/smbios/linux.go @@ -67,7 +67,7 @@ func (s *LinuxSmbiosManager) Info() (*SmBiosInfo, error) { case "chassis_version": dst = &smInfo.ChassisInfo.Version case "product_family": - dst = &smInfo.SysInfo.Familiy + dst = &smInfo.SysInfo.Family case "product_name": dst = &smInfo.SysInfo.Model case "product_serial": diff --git a/providers/os/resources/smbios/smbios.go b/providers/os/resources/smbios/smbios.go index ec9df26375..5754555af4 100644 --- a/providers/os/resources/smbios/smbios.go +++ b/providers/os/resources/smbios/smbios.go @@ -29,7 +29,7 @@ type SysInfo struct { Version string SerialNumber string UUID string - Familiy string + Family string SKU string } diff --git a/providers/os/resources/smbios/smbios_test.go b/providers/os/resources/smbios/smbios_test.go index 3ad88bc27c..2a2416115c 100644 --- a/providers/os/resources/smbios/smbios_test.go +++ b/providers/os/resources/smbios/smbios_test.go @@ -35,7 +35,7 @@ func TestManagerCentos(t *testing.T) { Version: "1.2", SerialNumber: "0", UUID: "64f118d3-0060-4a4c-bf1f-a11d655c4d6f", - Familiy: "Virtual Machine", + Family: "Virtual Machine", SKU: "", }, BaseBoardInfo: BaseBoardInfo{ @@ -78,7 +78,7 @@ func TestManagerMacos(t *testing.T) { Version: "1.0", SerialNumber: "DAAAA111AA11", UUID: "e126775d-2368-4f51-9863-76d5df0c8108", - Familiy: "", + Family: "", SKU: "", }, BaseBoardInfo: BaseBoardInfo{ @@ -121,7 +121,7 @@ func TestManagerWindows(t *testing.T) { Version: "None", SerialNumber: "", UUID: "16BD4D56-6B98-23F9-493C-F6B14E7CFC0B", - Familiy: "", + Family: "", SKU: "", }, BaseBoardInfo: BaseBoardInfo{ diff --git a/providers/os/resources/updates/mac_updates.go b/providers/os/resources/updates/mac_updates.go index ab697cd873..a8710ea491 100644 --- a/providers/os/resources/updates/mac_updates.go +++ b/providers/os/resources/updates/mac_updates.go @@ -42,7 +42,7 @@ func ParseSoftwarePlistUpdates(input io.Reader) ([]OperatingSystemUpdate, error) var r io.ReadSeeker r, ok := input.(io.ReadSeeker) - // if the read seaker is not implemented lets cache stdout in-memory + // if the read seeker is not implemented lets cache stdout in-memory if !ok { packageList, err := io.ReadAll(input) if err != nil { diff --git a/providers/snowflake/connection/connection.go b/providers/snowflake/connection/connection.go index 1a3bac0518..31e18cb4e4 100644 --- a/providers/snowflake/connection/connection.go +++ b/providers/snowflake/connection/connection.go @@ -7,6 +7,7 @@ import ( "crypto/rsa" "encoding/pem" "errors" + "github.com/Snowflake-Labs/terraform-provider-snowflake/pkg/sdk" "github.com/snowflakedb/gosnowflake" "go.mondoo.com/cnquery/v11/providers-sdk/v1/inventory" @@ -77,7 +78,7 @@ func NewSnowflakeConnection(id uint32, asset *inventory.Asset, conf *inventory.C return conn, nil } -func parsePrivateKey(privateKeyBytes []byte, passhrase []byte) (*rsa.PrivateKey, error) { +func parsePrivateKey(privateKeyBytes []byte, passphrase []byte) (*rsa.PrivateKey, error) { privateKeyBlock, _ := pem.Decode(privateKeyBytes) if privateKeyBlock == nil { return nil, errors.New("could not decode private key") @@ -86,11 +87,11 @@ func parsePrivateKey(privateKeyBytes []byte, passhrase []byte) (*rsa.PrivateKey, var privateKey interface{} var err error if privateKeyBlock.Type == "ENCRYPTED PRIVATE KEY" { - if len(passhrase) == 0 { + if len(passphrase) == 0 { return nil, errors.New("private key is encrypted, but no passphrase provided") } - privateKey, err = ssh.ParseRawPrivateKeyWithPassphrase(privateKeyBlock.Bytes, passhrase) + privateKey, err = ssh.ParseRawPrivateKeyWithPassphrase(privateKeyBlock.Bytes, passphrase) if err != nil { return nil, errors.New("could not parse encrypted private key " + err.Error()) } diff --git a/providers/vsphere/connection/platform.go b/providers/vsphere/connection/platform.go index 058f4d6414..dffbded633 100644 --- a/providers/vsphere/connection/platform.go +++ b/providers/vsphere/connection/platform.go @@ -190,7 +190,7 @@ func (c *VsphereConnection) InstanceUUID() (string, error) { return "", err } - // NOTE: we do not use the ESXi host identifier here to distingush between the API and the host itself + // NOTE: we do not use the ESXi host identifier here to distinguish between the API and the host itself return host.Reference().Value, nil } diff --git a/utils/multierr/errors.go b/utils/multierr/errors.go index 0dffb3f1db..0d085c9f76 100644 --- a/utils/multierr/errors.go +++ b/utils/multierr/errors.go @@ -8,7 +8,7 @@ import ( "strings" ) -// withMessage and methods are taken frmo https://github.com/pkg/errors +// withMessage and methods are taken from https://github.com/pkg/errors // under BSD-2-Clause license type withMessage struct {