Another batch of minor typos (#1953)

Signed-off-by: Nathan Baulch <nathan.baulch@gmail.com>
This commit is contained in:
Nathan Baulch 2024-09-09 21:51:39 +10:00 committed by GitHub
parent 74cad3a2f3
commit 9b7bec31b4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
89 changed files with 106 additions and 106 deletions

View File

@ -11,7 +11,7 @@ VERSION="${RAW_VERSION#v}"
# Split off the build metadata part, if any
# (we won't actually include it in our final version, and handle it only for
# compleness against semver syntax.)
# completeness against semver syntax.)
IFS='+' read -ra VERSION BUILD_META <<< "$VERSION"
# Separate out the prerelease part, if any

View File

@ -98,7 +98,7 @@ func implicitProviderSource(services *disco.Disco) getproviders.Source {
// way to include them in bundles uploaded to Terraform Cloud, where
// there has historically otherwise been no way to use custom providers.
// - The "plugins" subdirectory of the CLI config search directory.
// (thats ~/.terraform.d/plugins or $XDG_DATA_HOME/opentofu/plugins
// (that's ~/.terraform.d/plugins or $XDG_DATA_HOME/opentofu/plugins
// on Unix systems, equivalents elsewhere)
// - The "plugins" subdirectory of any platform-specific search paths,
// following e.g. the XDG base directory specification on Unix systems,

View File

@ -142,7 +142,7 @@ func (m Module) Parent() Module {
// on the root module address.
//
// In practice, this just turns the last element of the receiver into a
// ModuleCall and then returns a slice of the receiever that excludes that
// ModuleCall and then returns a slice of the receiver that excludes that
// last part. This is just a convenience for situations where a call address
// is required, such as when dealing with *Reference and Referenceable values.
func (m Module) Call() (Module, ModuleCall) {

View File

@ -316,7 +316,7 @@ func (m ModuleInstance) Ancestors() []ModuleInstance {
// other value.
func (m ModuleInstance) IsAncestor(o ModuleInstance) bool {
// Longer or equal sized paths means the receiver cannot
// be an ancestor of the given module insatnce.
// be an ancestor of the given module instance.
if len(m) >= len(o) {
return false
}
@ -344,7 +344,7 @@ func (m ModuleInstance) IsAncestor(o ModuleInstance) bool {
// of the instance. To retain this, use CallInstance instead.
//
// In practice, this just turns the last element of the receiver into a
// ModuleCall and then returns a slice of the receiever that excludes that
// ModuleCall and then returns a slice of the receiver that excludes that
// last part. This is just a convenience for situations where a call address
// is required, such as when dealing with *Reference and Referenceable values.
func (m ModuleInstance) Call() (ModuleInstance, ModuleCall) {
@ -366,7 +366,7 @@ func (m ModuleInstance) Call() (ModuleInstance, ModuleCall) {
// on the root module address.
//
// In practice, this just turns the last element of the receiver into a
// ModuleCallInstance and then returns a slice of the receiever that excludes
// ModuleCallInstance and then returns a slice of the receiver that excludes
// that last part. This is just a convenience for situations where a call\
// address is required, such as when dealing with *Reference and Referenceable
// values.

View File

@ -201,7 +201,7 @@ func TestParseModuleSource(t *testing.T) {
},
// NOTE: We intentionally don't test the bitbucket.org shorthands
// here, because that detector makes direct HTTP tequests to the
// here, because that detector makes direct HTTP requests to the
// Bitbucket API and thus isn't appropriate for unit testing.
"Google Cloud Storage bucket implied, path prefix": {

View File

@ -29,7 +29,7 @@ import (
type MoveEndpoint struct {
// SourceRange is the location of the physical endpoint address
// in configuration, if this MoveEndpoint was decoded from a
// configuration expresson.
// configuration expression.
SourceRange tfdiags.SourceRange
// Internally we (ab)use AbsMoveable as the representation of our

View File

@ -42,7 +42,7 @@ var anyKey = anyKeyImpl('*')
type MoveEndpointInModule struct {
// SourceRange is the location of the physical endpoint address
// in configuration, if this MoveEndpoint was decoded from a
// configuration expresson.
// configuration expression.
SourceRange tfdiags.SourceRange
// The internals are unexported here because, as with MoveEndpoint,

View File

@ -344,7 +344,7 @@ func (b *Local) Operation(ctx context.Context, op *backend.Operation) (*backend.
}
// opWait waits for the operation to complete, and a stop signal or a
// cancelation signal.
// cancellation signal.
func (b *Local) opWait(
doneCh <-chan struct{},
stopCtx context.Context,

View File

@ -43,11 +43,11 @@ func (b *Backend) Workspaces() ([]string, error) {
if !strings.HasSuffix(vv.Key, stateFileSuffix) {
continue
}
// default worksapce
// default workspace
if path.Join(b.prefix, b.key) == vv.Key {
continue
}
// <prefix>/<worksapce>/<key>
// <prefix>/<workspace>/<key>
prefix := strings.TrimRight(b.prefix, "/") + "/"
parts := strings.Split(strings.TrimPrefix(vv.Key, prefix), "/")
if len(parts) > 0 && parts[0] != "" {

View File

@ -68,7 +68,7 @@ func TestBackendLocked(t *testing.T) {
backend.TestBackendStateLocks(t, b1, b2)
}
// use the this backen to test the remote.State implementation
// use this backend to test the remote.State implementation
func TestRemoteState(t *testing.T) {
defer Reset()
b := backend.TestBackendConfig(t, New(encryption.StateEncryptionDisabled()), hcl.EmptyBody())

View File

@ -72,7 +72,7 @@ func (b *Backend) Workspaces() ([]string, error) {
lastObj := ""
for {
for _, obj := range resp.Objects {
// we have 3 parts, the state prefix, the workspace name, and the state file: <prefix>/<worksapce-name>/<key>
// we have 3 parts, the state prefix, the workspace name, and the state file: <prefix>/<workspace-name>/<key>
if path.Join(b.statePrefix, b.stateKey) == obj.Key {
// filter the default workspace
continue

View File

@ -52,7 +52,7 @@ func ExpectDiagsEqual(expected tfdiags.Diagnostics) diagsValidator {
type diagsValidator func(*testing.T, tfdiags.Diagnostics)
// ExpectDiagsMatching returns a validator expeceting a single Diagnostic with fields matching the expectation
// ExpectDiagsMatching returns a validator expecting a single Diagnostic with fields matching the expectation
func ExpectDiagsMatching(severity tfdiags.Severity, summary matcher, detail matcher) diagsValidator {
return func(t *testing.T, diags tfdiags.Diagnostics) {
for _, d := range diags {

View File

@ -300,7 +300,7 @@ func (c *ApplyCommand) OperationRequest(
func (c *ApplyCommand) GatherVariables(args *arguments.Vars) {
// FIXME the arguments package currently trivially gathers variable related
// arguments in a heterogenous slice, in order to minimize the number of
// arguments in a heterogeneous slice, in order to minimize the number of
// code paths gathering variables during the transition to this structure.
// Once all commands that gather variables have been converted to this
// structure, we could move the variable gathering code to the arguments

View File

@ -233,7 +233,7 @@ func extendedFlagSet(name string, state *State, operation *Operation, vars *Vars
f.Var((*flagStringSlice)(&operation.forceReplaceRaw), "replace", "replace")
}
// Gather all -var and -var-file arguments into one heterogenous structure
// Gather all -var and -var-file arguments into one heterogeneous structure
// to preserve the overall order.
if vars != nil {
varsFlags := newFlagNameValueSlice("-var")

View File

@ -241,7 +241,7 @@ func envConfig(env map[string]string) *Config {
config := &Config{}
if envPluginCacheDir := env[pluginCacheDirEnvVar]; envPluginCacheDir != "" {
// No Expandenv here, because expanding environment variables inside
// No ExpandEnv here, because expanding environment variables inside
// an environment variable would be strange and seems unnecessary.
// (User can expand variables into the value while setting it using
// standard shell features.)

View File

@ -14,7 +14,7 @@ import (
)
// use fcntl POSIX locks for the most consistent behavior across platforms, and
// hopefully some campatibility over NFS and CIFS.
// hopefully some compatibility over NFS and CIFS.
func (s *LocalState) lock() error {
flock := &syscall.Flock_t{
Type: syscall.F_RDLCK | syscall.F_WRLCK,

View File

@ -843,9 +843,9 @@ func testRemoteState(t *testing.T, s *states.State, c int) (*legacy.State, *http
return retState, srv
}
// testlockState calls a separate process to the lock the state file at path.
// testLockState calls a separate process to the lock the state file at path.
// deferFunc should be called in the caller to properly unlock the file.
// Since many tests change the working directory, the sourcedir argument must be
// Since many tests change the working directory, the sourceDir argument must be
// supplied to locate the statelocker.go source.
func testLockState(t *testing.T, sourceDir, path string) (func(), error) {
// build and run the binary ourselves so we can quickly terminate it for cleanup

View File

@ -59,7 +59,7 @@ func TestConsole_multiline_interactive(t *testing.T) {
var.counts.lololo`,
expected: "\n1\n2\n",
},
"backets_multi_line": {
"brackets_multi_line": {
input: `
var.counts.lalala
split(
@ -68,7 +68,7 @@ func TestConsole_multiline_interactive(t *testing.T) {
)`,
expected: "\n1\ntolist([\n \"lalala\",\n \"lolol\",\n \"lelelele\",\n])\n",
},
"baces_multi_line": {
"braces_multi_line": {
input: `
{
for key, value in var.counts : key => value

View File

@ -62,7 +62,7 @@ func TestConsole_tfvars(t *testing.T) {
testCopyDir(t, testFixturePath("apply-vars"), td)
defer testChdir(t, td)()
// Write a terraform.tvars
// Write a terraform.tfvars
varFilePath := filepath.Join(td, "terraform.tfvars")
if err := os.WriteFile(varFilePath, []byte(applyVarFile), 0644); err != nil {
t.Fatalf("err: %s", err)
@ -277,7 +277,7 @@ func TestConsole_multiline_pipe(t *testing.T) {
var.counts.lololo`,
expected: "\n1\n2\n",
},
"backets_multi_line": {
"brackets_multi_line": {
input: `
var.counts.lalala
split(
@ -286,7 +286,7 @@ func TestConsole_multiline_pipe(t *testing.T) {
)`,
expected: "\n1\ntolist([\n \"lalala\",\n \"lolol\",\n \"lelelele\",\n])\n",
},
"baces_multi_line": {
"braces_multi_line": {
input: `
{
for key, value in var.counts : key => value

View File

@ -4,7 +4,7 @@
// SPDX-License-Identifier: MPL-2.0
// Package format contains helpers for formatting various OpenTofu
// structures for human-readabout output.
// structures for human-readable output.
//
// This package is used by the official OpenTofu CLI in formatting any
// output and is exported to encourage non-official frontends to mimic the

View File

@ -78,7 +78,7 @@ func ObjectValueID(obj cty.Value) (k, v string) {
//
// Callers that use both ObjectValueName and ObjectValueID at the same time
// should be prepared to get the same attribute key and value from both in
// some cases, since there is overlap betweek the id-extraction and
// some cases, since there is overlap between the id-extraction and
// name-extraction heuristics.
//
// This function will panic if the given value is not of an object type.

View File

@ -970,7 +970,7 @@ func (c *InitCommand) getProviders(ctx context.Context, config *configs.Config,
if !newLocks.Equal(previousLocks) {
// if readonly mode
if flagLockfile == "readonly" {
// check if required provider dependences change
// check if required provider dependencies change
if !newLocks.EqualProviderAddress(previousLocks) {
diags = diags.Append(tfdiags.Sourceless(
tfdiags.Error,

View File

@ -932,7 +932,7 @@ func TestInit_backendCloudInvalidOptions(t *testing.T) {
// just silently ignoring them, so that users will be aware that
// Cloud mode has more of an expected "happy path" than the
// less-vertically-integrated backends do, and to avoid these
// unapplicable options becoming compatibility constraints for
// inapplicable options becoming compatibility constraints for
// future evolution of Cloud mode.
// We use the same starting fixture for all of these tests, but some
@ -2314,7 +2314,7 @@ provider "registry.opentofu.org/hashicorp/test" {
want: badLockFile,
},
{
desc: "reject to change required provider dependences",
desc: "reject to change required provider dependencies",
fixture: "init-provider-lock-file-readonly-add",
providers: map[string][]string{
"test": {"1.2.3"},

View File

@ -14,7 +14,7 @@ type Schema struct {
Block *Block `json:"block,omitempty"`
}
// marshalSchema is a convenience wrapper around mashalBlock. Schema version
// marshalSchema is a convenience wrapper around marshalBlock. Schema version
// should be set by the caller.
func marshalSchema(schema providers.Schema) *Schema {
if schema.Block == nil {

View File

@ -13,7 +13,7 @@ import (
"github.com/opentofu/opentofu/internal/tfdiags"
)
// dependenclyLockFilename is the filename of the dependency lock file.
// dependencyLockFilename is the filename of the dependency lock file.
//
// This file should live in the same directory as the .tf files for the
// root module of the configuration, alongside the .terraform directory

View File

@ -111,7 +111,7 @@ func (c *OutputCommand) Outputs(statePath string, enc encryption.Encryption) (ma
func (c *OutputCommand) GatherVariables(args *arguments.Vars) {
// FIXME the arguments package currently trivially gathers variable related
// arguments in a heterogenous slice, in order to minimize the number of
// arguments in a heterogeneous slice, in order to minimize the number of
// code paths gathering variables during the transition to this structure.
// Once all commands that gather variables have been converted to this
// structure, we could move the variable gathering code to the arguments

View File

@ -182,7 +182,7 @@ func (c *PlanCommand) OperationRequest(
func (c *PlanCommand) GatherVariables(args *arguments.Vars) {
// FIXME the arguments package currently trivially gathers variable related
// arguments in a heterogenous slice, in order to minimize the number of
// arguments in a heterogeneous slice, in order to minimize the number of
// code paths gathering variables during the transition to this structure.
// Once all commands that gather variables have been converted to this
// structure, we could move the variable gathering code to the arguments

View File

@ -66,7 +66,7 @@ func TestProvidersSchema_output(t *testing.T) {
ProviderSource: providerSource,
}
// `terrafrom init`
// `terraform init`
ic := &InitCommand{
Meta: m,
}

View File

@ -165,7 +165,7 @@ func (c *RefreshCommand) OperationRequest(be backend.Enhanced, view views.Refres
func (c *RefreshCommand) GatherVariables(args *arguments.Vars) {
// FIXME the arguments package currently trivially gathers variable related
// arguments in a heterogenous slice, in order to minimize the number of
// arguments in a heterogeneous slice, in order to minimize the number of
// code paths gathering variables during the transition to this structure.
// Once all commands that gather variables have been converted to this
// structure, we could move the variable gathering code to the arguments

View File

@ -140,7 +140,7 @@ func (c *ShowCommand) Synopsis() string {
func (c *ShowCommand) GatherVariables(args *arguments.Vars) {
// FIXME the arguments package currently trivially gathers variable related
// arguments in a heterogenous slice, in order to minimize the number of
// arguments in a heterogeneous slice, in order to minimize the number of
// code paths gathering variables during the transition to this structure.
// Once all commands that gather variables have been converted to this
// structure, we could move the variable gathering code to the arguments

View File

@ -5,7 +5,7 @@ provider foo {}
// terraform-providers/baz
provider baz {}
// This will try to install hashicrop/frob, fail, find no suggestions, and
// This will try to install hashicorp/frob, fail, find no suggestions, and
// result in an error
provider frob {}

View File

@ -73,7 +73,7 @@ func (c *ValidateCommand) Run(rawArgs []string) int {
func (c *ValidateCommand) GatherVariables(args *arguments.Vars) {
// FIXME the arguments package currently trivially gathers variable related
// arguments in a heterogenous slice, in order to minimize the number of
// arguments in a heterogeneous slice, in order to minimize the number of
// code paths gathering variables during the transition to this structure.
// Once all commands that gather variables have been converted to this
// structure, we could move the variable gathering code to the arguments

View File

@ -45,7 +45,7 @@ var (
randLock sync.Mutex
randShared *rand.Rand
// enable ssh keeplive probes by default
// enable ssh keepalive probes by default
keepAliveInterval = 2 * time.Second
// max time to wait for for a KeepAlive response before considering the

View File

@ -84,7 +84,7 @@ type connectionInfo struct {
}
// decodeConnInfo decodes the given cty.Value using the same behavior as the
// lgeacy mapstructure decoder in order to preserve as much of the existing
// legacy mapstructure decoder in order to preserve as much of the existing
// logic as possible for compatibility.
func decodeConnInfo(v cty.Value) (*connectionInfo, error) {
connInfo := &connectionInfo{}

View File

@ -53,7 +53,7 @@ type connectionInfo struct {
}
// decodeConnInfo decodes the given cty.Value using the same behavior as the
// lgeacy mapstructure decoder in order to preserve as much of the existing
// legacy mapstructure decoder in order to preserve as much of the existing
// logic as possible for compatibility.
func decodeConnInfo(v cty.Value) (*connectionInfo, error) {
connInfo := &connectionInfo{}

View File

@ -78,7 +78,7 @@ func (b *Backend) Decode(schema *configschema.Block) (cty.Value, hcl.Diagnostics
})
}
// This is a hack that may not be needed, but preserves the idea that invalid backends will show a cryptic error about running init duing plan/apply startup.
// This is a hack that may not be needed, but preserves the idea that invalid backends will show a cryptic error about running init during plan/apply startup.
func (b *Backend) referenceDiagnostics(schema *configschema.Block) hcl.Diagnostics {
var diags hcl.Diagnostics

View File

@ -14,7 +14,7 @@ import (
)
// CoerceValue attempts to force the given value to conform to the type
// implied by the receiever.
// implied by the receiver.
//
// This is useful in situations where a configuration must be derived from
// an already-decoded value. It is always better to decode directly from

View File

@ -189,7 +189,7 @@ func (mvc MockValueComposer) composeMockValueForBlocks(schema *configschema.Bloc
diags = diags.Append(tfdiags.WholeContainingBody(
tfdiags.Warning,
fmt.Sprintf("Ignored mock/override field `%v`", k),
"Cannot overridde block value, because it's not present in configuration.",
"Cannot override block value, because it's not present in configuration.",
))
}
@ -215,7 +215,7 @@ func (mvc MockValueComposer) composeMockValueForBlocks(schema *configschema.Bloc
}
// getMockValueForBlock uses an object from the defaults (overrides)
// to compose each value from the block's inner collection. It recursevily calls
// to compose each value from the block's inner collection. It recursively calls
// composeMockValueBySchema to proceed with all the inner attributes and blocks
// the same way so all the nested blocks follow the same logic.
func (mvc MockValueComposer) getMockValueForBlock(targetType cty.Type, configVal cty.Value, block *configschema.Block, defaults map[string]cty.Value) (cty.Value, tfdiags.Diagnostics) {

View File

@ -189,8 +189,8 @@ func valuesSDKEquivalentMappings(a, b cty.Value) bool {
// precision in the round-trip.
//
// This does _not_ attempt to allow for an epsilon difference that may be
// caused by accumulated innacuracy in a float calculation, under the
// expectation that providers generally do not actually do compuations on
// caused by accumulated inaccuracy in a float calculation, under the
// expectation that providers generally do not actually do computations on
// floats and instead just pass string representations of them on verbatim
// to remote APIs. A remote API _itself_ may introduce inaccuracy, but that's
// a problem for the provider itself to deal with, based on its knowledge of

View File

@ -215,7 +215,7 @@ func (g *marshalGraph) writeBody(opts *DotOpts, w *indentWriter) {
dotEdges = append(dotEdges, e.dot(g))
}
// srot these again to match the old output
// sort these again to match the old output
sort.Strings(dotEdges)
for _, e := range dotEdges {
@ -266,7 +266,7 @@ func (w *indentWriter) Indent() { w.level++ }
// Unindent decreases indentation by 1
func (w *indentWriter) Unindent() { w.level-- }
// the following methods intercecpt the byte.Buffer writes and insert the
// the following methods intercept the byte.Buffer writes and insert the
// indentation when starting a new line.
func (w *indentWriter) Write(b []byte) (int, error) {
w.indent()

View File

@ -438,7 +438,7 @@ func (l *ProviderLock) ContainsAll(target *ProviderLock) bool {
// upgrade purposes.
//
// At least one of the given hashes must match for a package to be considered
// valud.
// valid.
func (l *ProviderLock) PreferredHashes() []getproviders.Hash {
return getproviders.PreferredHashes(l.hashes)
}

View File

@ -91,7 +91,7 @@ var currentExperiments = make(Set)
//
// After an experiment has been concluded for a whole major release span it can
// be removed, since we expect users to perform upgrades one major release at
// at time without skipping and thus they will see the concludedness error
// a time without skipping and thus they will see the concludedness error
// message as they upgrade through a prior major version.
//
// Members of this map are registered in the init function above.

View File

@ -19,7 +19,7 @@ import (
type ErrHostNoProviders struct {
Hostname svchost.Hostname
// HasOtherVersionis set to true if the discovery process detected
// HasOtherVersion is set to true if the discovery process detected
// declarations of services named "providers" whose version numbers did not
// match any version supported by the current version of OpenTofu.
//

View File

@ -108,7 +108,7 @@ func (s *MockSource) PackageMeta(ctx context.Context, provider addrs.Provider, v
}
}
// CallLog returns a list of calls to other methods of the receiever that have
// CallLog returns a list of calls to other methods of the receiver that have
// been called since it was created, in case a calling test wishes to verify
// a particular sequence of operations.
//

View File

@ -358,7 +358,7 @@ func TestMultiSourcePackageMeta(t *testing.T) {
)
// This case reports "platform not supported" because it assumes that
// a caller would only pass to it package versions that were returned
// by a previousc all to AvailableVersions, and therefore a missing
// by a previous call to AvailableVersions, and therefore a missing
// object ought to be valid provider/version but an unsupported
// platform.
if want, ok := err.(ErrPlatformNotSupported); !ok {

View File

@ -50,7 +50,7 @@ type Warnings = []string
// altogether, which means that it is not required at all.
type Requirements map[addrs.Provider]VersionConstraints
// Merge takes the requirements in the receiever and the requirements in the
// Merge takes the requirements in the receiver and the requirements in the
// other given value and produces a new set of requirements that combines
// all of the requirements of both.
//

View File

@ -1729,7 +1729,7 @@ func TestTranspose(t *testing.T) {
cty.NilVal,
true,
},
{ // marks (deep or shallow) on any elements will propegate to the entire return value
{ // marks (deep or shallow) on any elements will propagate to the entire return value
cty.MapVal(map[string]cty.Value{
"key1": cty.ListVal([]cty.Value{
cty.StringVal("a").Mark("beep"), // mark on the inner list element

View File

@ -101,7 +101,7 @@ func TestBase64Sha256(t *testing.T) {
cty.StringVal("n4bQgYhMfWWaL+qgxVrQFaO/TxsrC4Is0V1sFbDwCgg="),
false,
},
// This would differ because we're base64-encoding hex represantiation, not raw bytes.
// This would differ because we're base64-encoding hex representation, not raw bytes.
// base64encode(sha256("test")) =
// "OWY4NmQwODE4ODRjN2Q2NTlhMmZlYWEwYzU1YWQwMTVhM2JmNGYxYjJiMGI4MjJjZDE1ZDZjMTViMGYwMGEwOA=="
}
@ -182,7 +182,7 @@ func TestBase64Sha512(t *testing.T) {
cty.StringVal("7iaw3Ur350mqGo7jwQrpkj9hiYB3Lkc/iBml1JQODbJ6wYX4oOHV+E+IvIh/1nsUNzLDBMxfqa2Ob1f1ACio/w=="),
false,
},
// This would differ because we're base64-encoding hex represantiation, not raw bytes
// This would differ because we're base64-encoding hex representation, not raw bytes
// base64encode(sha512("test")) =
// "OZWUyNmIwZGQ0YWY3ZTc0OWFhMWE4ZWUzYzEwYWU5OTIzZjYxODk4MDc3MmU0NzNmODgxOWE1ZDQ5NDBlMGRiMjdhYzE4NWY4YTBlMWQ1Zjg0Zjg4YmM4ODdmZDY3YjE0MzczMmMzMDRjYzVmYTlhZDhlNmY1N2Y1MDAyOGE4ZmY="
}

View File

@ -93,7 +93,7 @@ var TimeCmpFunc = function.New(&function.Spec{
case tsA.Before(tsB):
return cty.NumberIntVal(-1), nil
default:
// By elimintation, tsA must be after tsB.
// By elimination, tsA must be after tsB.
return cty.NumberIntVal(1), nil
}
},

View File

@ -1038,7 +1038,7 @@ func TestResourceDataGetOk(t *testing.T) {
Ok: false,
},
// Further illustrates and clarifiies the GetOk semantics from #933, and
// Further illustrates and clarifies the GetOk semantics from #933, and
// highlights the limitation that zero-value config is currently
// indistinguishable from unset config.
{

View File

@ -1001,7 +1001,7 @@ func TestInstanceDiffSame(t *testing.T) {
"",
},
// Innner computed set should allow outer change in key
// Inner computed set should allow outer change in key
{
&InstanceDiff{
Attributes: map[string]*ResourceAttrDiff{
@ -1048,7 +1048,7 @@ func TestInstanceDiffSame(t *testing.T) {
"",
},
// Innner computed list should allow outer change in key
// Inner computed list should allow outer change in key
{
&InstanceDiff{
Attributes: map[string]*ResourceAttrDiff{

View File

@ -59,7 +59,7 @@ var rootModulePath = []string{"root"}
// normalizeModulePath takes a raw module path and returns a path that
// has the rootModulePath prepended to it. If I could go back in time I
// would've never had a rootModulePath (empty path would be root). We can
// still fix this but thats a big refactor that my branch doesn't make sense
// still fix this but that's a big refactor that my branch doesn't make sense
// for. Instead, this function normalizes paths.
func normalizeModulePath(p []string) addrs.ModuleInstance {
// FIXME: Remove this once everyone is using addrs.ModuleInstance.
@ -964,7 +964,7 @@ func (s *OutputState) deepcopy() *OutputState {
// module.
type ModuleState struct {
// Path is the import path from the root module. Modules imports are
// always disjoint, so the path represents amodule tree
// always disjoint, so the path represents a module tree
Path []string `json:"path"`
// Locals are kept only transiently in-memory, because we can always
@ -2111,7 +2111,7 @@ func ReadStateV3(jsonBytes []byte) (*State, error) {
// Sort it
state.sort()
// Now we write the state back out to detect any changes in normaliztion.
// Now we write the state back out to detect any changes in normalization.
// If our state is now written out differently, bump the serial number to
// prevent conflicts.
var buf bytes.Buffer

View File

@ -262,7 +262,7 @@ func (s StateFilterResultSlice) Less(i, j int) bool {
return addrA.Index < addrB.Index
}
// If the addresses are different it is just lexographic sorting
// If the addresses are different it is just lexicographic sorting
if a.Address != b.Address {
return a.Address < b.Address
}

View File

@ -41,7 +41,7 @@ type remoteStateV1 struct {
type moduleStateV1 struct {
// Path is the import path from the root module. Modules imports are
// always disjoint, so the path represents amodule tree
// always disjoint, so the path represents a module tree
Path []string `json:"path"`
// Outputs declared by the module and maintained for each module

View File

@ -63,8 +63,8 @@ func PanicHandler() {
//
// This only is a partial solution to the problem of panics within deeply nested
// go-routines. It only works between the go-routine being called and the calling
// go-routine. If you have multiple nested go-rotuines, it will only preserve the
// calling stack and the called panic stack. Idealy we would be able to use context
// go-routine. If you have multiple nested go-routines, it will only preserve the
// calling stack and the called panic stack. Ideally we would be able to use context
// or a similar construct to build a more comprehensive panic handler, but this
// is a significant step in the right direction that will dramatically improve crash
// debugging

View File

@ -282,7 +282,7 @@ func (rc *ResourceInstanceChange) Moved() bool {
}
// Simplify will, where possible, produce a change with a simpler action than
// the receiever given a flag indicating whether the caller is dealing with
// the receiver given a flag indicating whether the caller is dealing with
// a normal apply or a destroy. This flag deals with the fact that OpenTofu
// Core uses a specialized graph node type for destroying; only that
// specialized node should set "destroying" to true.

View File

@ -60,7 +60,7 @@ func NewDynamicValue(val cty.Value, ty cty.Type) (DynamicValue, error) {
return DynamicValue(buf), nil
}
// Decode retrieves the effective value from the receiever by interpreting the
// Decode retrieves the effective value from the receiver by interpreting the
// serialized form against the given type constraint. For correct results,
// the type constraint must match (or be consistent with) the one that was
// used to create the receiver.

View File

@ -148,7 +148,7 @@ func assertObjectCompatible(schema *configschema.Block, planned, actual cty.Valu
}
plannedL := plannedV.LengthInt()
actualL := actualV.LengthInt()
if plannedL != actualL && plannedV.IsKnown() { // new blocks may appear if unknown blocks were persent in the plan
if plannedL != actualL && plannedV.IsKnown() { // new blocks may appear if unknown blocks were present in the plan
errs = append(errs, path.NewErrorf("block count changed from %d to %d", plannedL, actualL))
continue
}

View File

@ -1354,7 +1354,7 @@ func TestAssertObjectCompatible(t *testing.T) {
}),
nil,
},
// test a set with a patially known dynamic count reducing it's values
// test a set with a partially known dynamic count reducing it's values
{
&configschema.Block{
BlockTypes: map[string]*configschema.NestedBlock{

View File

@ -98,7 +98,7 @@ func ProtoToProviderSchema(s *proto.Schema) providers.Schema {
}
}
// ProtoToConfigSchema takes the GetSchcema_Block from a grpc response and converts it
// ProtoToConfigSchema takes the Schema_Block from a grpc response and converts it
// to a tofu *configschema.Block.
func ProtoToConfigSchema(b *proto.Schema_Block) *configschema.Block {
block := &configschema.Block{

View File

@ -11,7 +11,7 @@ import (
"github.com/opentofu/opentofu/internal/tofu"
)
// UIOutput is an implementatin of tofu.UIOutput that communicates
// UIOutput is an implementation of tofu.UIOutput that communicates
// over RPC.
type UIOutput struct {
Client *rpc.Client

View File

@ -104,7 +104,7 @@ func ProtoToProviderSchema(s *proto.Schema) providers.Schema {
}
}
// ProtoToConfigSchema takes the GetSchcema_Block from a grpc response and converts it
// ProtoToConfigSchema takes the Schema_Block from a grpc response and converts it
// to a tofu *configschema.Block.
func ProtoToConfigSchema(b *proto.Schema_Block) *configschema.Block {
block := &configschema.Block{

View File

@ -117,7 +117,7 @@ func (cp *CachedProvider) ExecutableFile() (string, error) {
// expect an executable file whose name starts with
// "terraform-provider-happycloud", followed by zero or more additional
// characters. If there _are_ additional characters then the first one
// must be an underscore or a period, like in thse examples:
// must be an underscore or a period, like in these examples:
// - terraform-provider-happycloud_v1.0.0
// - terraform-provider-happycloud.exe
//

View File

@ -230,7 +230,7 @@ type UpgradeResourceStateRequest struct {
// Version is version of the schema that created the current state.
Version int64
// RawStateJSON and RawStateFlatmap contiain the state that needs to be
// RawStateJSON and RawStateFlatmap contain the state that needs to be
// upgraded to match the current schema version. Because the schema is
// unknown, this contains only the raw data as stored in the state.
// RawStateJSON is the current json state encoding.

View File

@ -137,7 +137,7 @@ func impliedMoveStatements(cfg *configs.Config, prevRunState *states.State, expl
}
if fromKey != toKey {
// We mustn't generate an impied statement if the user already
// We mustn't generate an implied statement if the user already
// wrote an explicit statement referring to this resource,
// because they may wish to select an instance key other than
// zero as the one to retain.

View File

@ -63,7 +63,7 @@ var (
})
)
// All the locationes from the mockRegistry start with a file:// scheme. If
// All the locations from the mockRegistry start with a file:// scheme. If
// the location string here doesn't have a scheme, the mockRegistry will
// find the absolute path and return a complete URL.
var testMods = map[string][]testMod{
@ -213,7 +213,7 @@ func mockRegHandler(config map[uint8]struct{}) http.Handler {
}
// only adding the single requested module for now
// this is the minimal that any regisry is expected to support
// this is the minimal that any registry is expected to support
mpvs := &response.ModuleProviderVersions{
Source: name,
}

View File

@ -371,7 +371,7 @@ func TestTypeString(t *testing.T) {
Input cty.Value
Want string
}{
// Primititves
// Primitives
{
cty.StringVal("a"),
"string",

View File

@ -37,7 +37,7 @@ type ResourceInstanceObject struct {
Status ObjectStatus
// Dependencies is a set of absolute address to other resources this
// instance dependeded on when it was applied. This is used to construct
// instance depended on when it was applied. This is used to construct
// the dependency relationships for an object whose configuration is no
// longer available, such as if it has been removed from configuration
// altogether, or is now deposed.

View File

@ -433,7 +433,7 @@ func (s *State) MoveAbsResource(src, dst addrs.AbsResource) {
// or not the move occurred. This function will panic if either the src does not
// exist or the dst does exist (but not both).
func (s *State) MaybeMoveAbsResource(src, dst addrs.AbsResource) bool {
// Get the source and destinatation addresses from state.
// Get the source and destination addresses from state.
rs := s.Resource(src)
ds := s.Resource(dst)

View File

@ -75,7 +75,7 @@ type remoteStateV1 struct {
type moduleStateV1 struct {
// Path is the import path from the root module. Modules imports are
// always disjoint, so the path represents amodule tree
// always disjoint, so the path represents a module tree
Path []string `json:"path"`
// Outputs declared by the module and maintained for each module

View File

@ -103,7 +103,7 @@ type outputStateV2 struct {
type moduleStateV2 struct {
// Path is the import path from the root module. Modules imports are
// always disjoint, so the path represents amodule tree
// always disjoint, so the path represents a module tree
Path []string `json:"path"`
// Locals are kept only transiently in-memory, because we can always

View File

@ -95,7 +95,7 @@ func NewFilesystemBetweenPaths(readPath, writePath string, enc encryption.StateE
}
}
// SetBackupPath configures the receiever so that it will create a local
// SetBackupPath configures the receiver so that it will create a local
// backup file of the next state snapshot it reads (in State) if a different
// snapshot is subsequently written (in WriteState). Only one backup is
// written for the lifetime of the object, unless reset as described below.

View File

@ -15,7 +15,7 @@ import (
)
// use fcntl POSIX locks for the most consistent behavior across platforms, and
// hopefully some campatibility over NFS and CIFS.
// hopefully some compatibility over NFS and CIFS.
func (s *Filesystem) lock() error {
log.Printf("[TRACE] statemgr.Filesystem: locking %s using fcntl flock", s.path)
flock := &syscall.Flock_t{

View File

@ -63,7 +63,7 @@ func TestLockWithContext(t *testing.T) {
t.Fatal("lock should have failed immediately")
}
// block until LockwithContext has made a first attempt
// block until LockWithContext has made a first attempt
attempted := make(chan struct{})
postLockHook = func() {
close(attempted)
@ -87,7 +87,7 @@ func TestLockWithContext(t *testing.T) {
t.Fatal("lock should have completed within 2s:", err)
}
// ensure the goruotine completes
// ensure the goroutine completes
<-unlocked
if unlockErr != nil {
t.Fatal(unlockErr)

View File

@ -426,7 +426,7 @@ func (c *Context) checkConfigDependencies(config *configs.Config) tfdiags.Diagno
// so they are at least always consistent alone. This ordering is
// arbitrary and not a compatibility constraint.
sort.Slice(diags, func(i, j int) bool {
// Because these are sourcelss diagnostics and we know they are all
// Because these are sourceless diagnostics and we know they are all
// errors, we know they'll only differ in their description fields.
descI := diags[i].Description()
descJ := diags[j].Description()

View File

@ -189,7 +189,7 @@ func (c *Context) applyGraph(plan *plans.Plan, config *configs.Config, validate
return graph, operation, diags
}
// ApplyGraphForUI is a last vestage of graphs in the public interface of
// ApplyGraphForUI is a last vestige of graphs in the public interface of
// Context (as opposed to graphs as an implementation detail) intended only for
// use by the "tofu graph" command when asked to render an apply-time
// graph.

View File

@ -2619,7 +2619,7 @@ func TestContext2Apply_moduleDestroyOrder(t *testing.T) {
if id == "b" {
// Pause briefly to make any race conditions more visible, since
// missing edges here can cause undeterministic ordering.
// missing edges here can cause indeterministic ordering.
time.Sleep(100 * time.Millisecond)
}
@ -11410,7 +11410,7 @@ locals {
// Ensure that we can destroy when a provider references a resource that will
// also be destroyed
func TestContext2Apply_destroyProviderReference(t *testing.T) {
m, snap := testModuleWithSnapshot(t, "apply-destroy-provisider-refs")
m, snap := testModuleWithSnapshot(t, "apply-destroy-provider-refs")
schemaFn := func(name string) *ProviderSchema {
return &ProviderSchema{

View File

@ -49,7 +49,7 @@ func TestContextEval(t *testing.T) {
},
}
// This module has a little bit of everything (and if it is missing somehitng, add to it):
// This module has a little bit of everything (and if it is missing something, add to it):
// resources, variables, locals, modules, output
m := testModule(t, "eval-context-basic")
p := testProvider("test")

View File

@ -946,7 +946,7 @@ func (c *Context) driftedResources(config *configs.Config, oldState, newState *s
return drs, diags
}
// PlanGraphForUI is a last vestage of graphs in the public interface of Context
// PlanGraphForUI is a last vestige of graphs in the public interface of Context
// (as opposed to graphs as an implementation detail) intended only for use
// by the "tofu graph" command when asked to render a plan-time graph.
//

View File

@ -7135,7 +7135,7 @@ func TestContext2Plan_removedResourceInChildModuleFromChildModule(t *testing.T)
state := states.BuildState(func(s *states.SyncState) {
// The prior state tracks module.mod.test_object.a.a, which we should be
// removed from the state by the "removed" block in the child mofule config.
// removed from the state by the "removed" block in the child module config.
s.SetResourceInstanceCurrent(addr, &states.ResourceInstanceObjectSrc{
AttrsJSON: []byte(`{}`),
Status: states.ObjectReady,

View File

@ -3523,7 +3523,7 @@ func TestContext2Plan_hook(t *testing.T) {
func TestContext2Plan_closeProvider(t *testing.T) {
// this fixture only has an aliased provider located in the module, to make
// sure that the provier name contains a path more complex than
// sure that the provider name contains a path more complex than
// "provider.aws".
m := testModule(t, "plan-close-module-provider")
p := testProvider("aws")

View File

@ -32,7 +32,7 @@ func evalReplaceTriggeredByExpr(expr hcl.Expression, keyData instances.Repetitio
return ref, diags
}
// trggersExprToTraversal takes an hcl expression limited to the syntax allowed
// triggersExprToTraversal takes an hcl expression limited to the syntax allowed
// in replace_triggered_by, and converts it to a static traversal. The
// RepetitionData contains the data necessary to evaluate the only allowed
// variables in the expression, count.index and each.key.

View File

@ -11,7 +11,7 @@ import (
"github.com/opentofu/opentofu/internal/dag"
)
// testGraphnotContains is an assertion helper that tests that a node is
// testGraphNotContains is an assertion helper that tests that a node is
// NOT contained in the graph.
func testGraphNotContains(t *testing.T, g *Graph, name string) {
for _, v := range g.Vertices() {

View File

@ -248,7 +248,7 @@ const (
// writeResourceInstanceState saves the given object as the current object for
// the selected resource instance.
//
// dependencies is a parameter, instead of those directly attacted to the
// dependencies is a parameter, instead of those directly attached to the
// NodeAbstractResourceInstance, because we don't write dependencies for
// datasources.
//

View File

@ -147,7 +147,7 @@ func stripRemovedStateAttributes(state []byte, ty cty.Type) []byte {
js, err := json.Marshal(jsonMap)
if err != nil {
// if the json map was somehow mangled enough to not marhsal, something
// if the json map was somehow mangled enough to not marshal, something
// went horribly wrong
panic(err)
}

View File

@ -191,7 +191,7 @@ func (vv InputValues) JustValues() map[string]cty.Value {
}
// SameValues returns true if the given InputValues has the same values as
// the receiever, disregarding the source types and source ranges.
// the receiver, disregarding the source types and source ranges.
//
// Values are compared using the cty "RawEquals" method, which means that
// unknown values can be considered equal to one another if they are of the

View File

@ -493,7 +493,7 @@ When generating these values, OpenTofu cannot follow custom provider logic, so i
| list | An empty list. |
| map | An empty map. |
| set | An empty set. |
| object | An object with its fields populated by the same logic recursevily. |
| object | An object with its fields populated by the same logic recursively. |
| tuple | An empty tuple. |
:::tip Note