Skip to content

Commit

Permalink
fix typos
Browse files Browse the repository at this point in the history
  • Loading branch information
nikpivkin committed Apr 3, 2024
1 parent a58b731 commit 4695a28
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 14 deletions.
6 changes: 3 additions & 3 deletions pkg/iac/scanners/terraform/parser/funcs/cidr.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
"github.com/zclconf/go-cty/cty/gocty"
)

// CidrHostFunc contructs a function that calculates a full host IP address
// CidrHostFunc constructs a function that calculates a full host IP address
// within a given IP network address prefix.
var CidrHostFunc = function.New(&function.Spec{
Params: []function.Parameter{
Expand Down Expand Up @@ -45,7 +45,7 @@ var CidrHostFunc = function.New(&function.Spec{
},
})

// CidrNetmaskFunc contructs a function that converts an IPv4 address prefix given
// CidrNetmaskFunc constructs a function that converts an IPv4 address prefix given
// in CIDR notation into a subnet mask address.
var CidrNetmaskFunc = function.New(&function.Spec{
Params: []function.Parameter{
Expand All @@ -70,7 +70,7 @@ var CidrNetmaskFunc = function.New(&function.Spec{
},
})

// CidrSubnetFunc contructs a function that calculates a subnet address within
// CidrSubnetFunc constructs a function that calculates a subnet address within
// a given IP network address prefix.
var CidrSubnetFunc = function.New(&function.Spec{
Params: []function.Parameter{
Expand Down
10 changes: 5 additions & 5 deletions pkg/iac/scanners/terraform/parser/funcs/crypto.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ var BcryptFunc = function.New(&function.Spec{
input := args[0].AsString()
out, err := bcrypt.GenerateFromPassword([]byte(input), defaultCost)
if err != nil {
return cty.UnknownVal(cty.String), fmt.Errorf("error occured generating password %s", err.Error())
return cty.UnknownVal(cty.String), fmt.Errorf("error occurred generating password %s", err.Error())
}

return cty.StringVal(string(out)), nil
Expand Down Expand Up @@ -170,7 +170,7 @@ var RsaDecryptFunc = function.New(&function.Spec{
case asn1.SyntaxError:
errStr = strings.ReplaceAll(e.Error(), "asn1: syntax error", "invalid ASN1 data in the given private key")
case asn1.StructuralError:
errStr = strings.ReplaceAll(e.Error(), "asn1: struture error", "invalid ASN1 data in the given private key")
errStr = strings.ReplaceAll(e.Error(), "asn1: structure error", "invalid ASN1 data in the given private key")
default:
errStr = fmt.Sprintf("invalid private key: %s", e)
}
Expand All @@ -190,7 +190,7 @@ var RsaDecryptFunc = function.New(&function.Spec{
},
})

// Sha1Func contructs a function that computes the SHA1 hash of a given string
// Sha1Func constructs a function that computes the SHA1 hash of a given string
// and encodes it with hexadecimal digits.
var Sha1Func = makeStringHashFunction(sha1.New, hex.EncodeToString)

Expand All @@ -200,7 +200,7 @@ func MakeFileSha1Func(target fs.FS, baseDir string) function.Function {
return makeFileHashFunction(target, baseDir, sha1.New, hex.EncodeToString)
}

// Sha256Func contructs a function that computes the SHA256 hash of a given string
// Sha256Func constructs a function that computes the SHA256 hash of a given string
// and encodes it with hexadecimal digits.
var Sha256Func = makeStringHashFunction(sha256.New, hex.EncodeToString)

Expand All @@ -210,7 +210,7 @@ func MakeFileSha256Func(target fs.FS, baseDir string) function.Function {
return makeFileHashFunction(target, baseDir, sha256.New, hex.EncodeToString)
}

// Sha512Func contructs a function that computes the SHA512 hash of a given string
// Sha512Func constructs a function that computes the SHA512 hash of a given string
// and encodes it with hexadecimal digits.
var Sha512Func = makeStringHashFunction(sha512.New, hex.EncodeToString)

Expand Down
2 changes: 1 addition & 1 deletion pkg/iac/scanners/terraform/parser/funcs/ip.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ func parseIPv4(s string) IP {
// backwards-incompatible change for Terraform users, who might have
// already written modules with leading zeroes.
//
//if c > 1 && s[0] == '0' {
// if c > 1 && s[0] == '0' {
// // Reject non-zero components with leading zeroes.
// return nil
//}
Expand Down
8 changes: 4 additions & 4 deletions pkg/iac/scanners/terraform/parser/funcs/number.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"github.com/zclconf/go-cty/cty/gocty"
)

// LogFunc contructs a function that returns the logarithm of a given number in a given base.
// LogFunc constructs a function that returns the logarithm of a given number in a given base.
var LogFunc = function.New(&function.Spec{
Params: []function.Parameter{
{
Expand Down Expand Up @@ -39,7 +39,7 @@ var LogFunc = function.New(&function.Spec{
},
})

// PowFunc contructs a function that returns the logarithm of a given number in a given base.
// PowFunc constructs a function that returns the logarithm of a given number in a given base.
var PowFunc = function.New(&function.Spec{
Params: []function.Parameter{
{
Expand Down Expand Up @@ -68,7 +68,7 @@ var PowFunc = function.New(&function.Spec{
},
})

// SignumFunc contructs a function that returns the closest whole number greater
// SignumFunc constructs a function that returns the closest whole number greater
// than or equal to the given value.
var SignumFunc = function.New(&function.Spec{
Params: []function.Parameter{
Expand All @@ -95,7 +95,7 @@ var SignumFunc = function.New(&function.Spec{
},
})

// ParseIntFunc contructs a function that parses a string argument and returns an integer of the specified base.
// ParseIntFunc constructs a function that parses a string argument and returns an integer of the specified base.
var ParseIntFunc = function.New(&function.Spec{
Params: []function.Parameter{
{
Expand Down
2 changes: 1 addition & 1 deletion pkg/iac/scanners/terraform/parser/funcs/string.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ var EndsWithFunc = function.New(&function.Spec{
})

// ReplaceFunc constructs a function that searches a given string for another
// given substring, and replaces each occurence with a given replacement string.
// given substring, and replaces each occurrence with a given replacement string.
var ReplaceFunc = function.New(&function.Spec{
Params: []function.Parameter{
{
Expand Down

0 comments on commit 4695a28

Please sign in to comment.