Skip to content

Commit

Permalink
Fix format
Browse files Browse the repository at this point in the history
  • Loading branch information
jocgir committed Jul 10, 2024
1 parent c4c7845 commit 9f5bbcc
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 8 deletions.
3 changes: 2 additions & 1 deletion config/config_helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,8 @@ func (ctx *resolveContext) getParentDir() (string, error) {
}

// Returns the named environment variable or default value if it does not exist
// get_env(variable_name, default_value)
//
// get_env(variable_name, default_value)
func (ctx *resolveContext) getEnvironmentVariable(env, defValue string) string {
if value, exists := ctx.options.Env[env]; exists {
return value
Expand Down
6 changes: 3 additions & 3 deletions configstack/running_module.go
Original file line number Diff line number Diff line change
Expand Up @@ -161,9 +161,9 @@ func toRunningModules(modules []*TerraformModule, dependencyOrder dependencyOrde

// Loop through the map of runningModules and for each module M:
//
// * If dependencyOrder is NormalOrder, plug in all the modules M depends on into the Dependencies field and all the
// modules that depend on M into the NotifyWhenDone field.
// * If dependencyOrder is ReverseOrder, do the reverse.
// - If dependencyOrder is NormalOrder, plug in all the modules M depends on into the Dependencies field and all the
// modules that depend on M into the NotifyWhenDone field.
// - If dependencyOrder is ReverseOrder, do the reverse.
func crossLinkDependencies(modules map[string]*runningModule, dependencyOrder dependencyOrder) (map[string]*runningModule, error) {
for _, module := range modules {
for _, dependency := range module.Module.Dependencies {
Expand Down
7 changes: 4 additions & 3 deletions util/collections.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,10 @@ func RemoveDuplicatesFromListKeepLast(list []string) []string {

// RemoveDuplicatesFromList returns a copy of the given list with all duplicates removed (keeping the last encountereds)
// Params:
// list: The list to filter
// keepLast: Indicates whether the last or first encountered duplicate element should be kept
// getKey: Function used to extract the actual key from the string
//
// list: The list to filter
// keepLast: Indicates whether the last or first encountered duplicate element should be kept
// getKey: Function used to extract the actual key from the string
func RemoveDuplicatesFromList(list []string, keepLast bool, getKey func(key string) string) []string {
out := make([]string, 0, len(list))
present := make(map[string]bool)
Expand Down
4 changes: 3 additions & 1 deletion util/random.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ import (
)

// GetRandomTime returns random time duration between the lower bound and upper bound. This is useful because some of our
// automated tests wound up flooding the AWS API all at once, leading to a "Subscriber limit exceeded" error.
//
// automated tests wound up flooding the AWS API all at once, leading to a "Subscriber limit exceeded" error.
//
// TODO: Some of the more exotic test cases fail, but it's not worth catching them given the intended use of this function.
func GetRandomTime(lowerBound, upperBound time.Duration) time.Duration {
if lowerBound < 0 {
Expand Down

0 comments on commit 9f5bbcc

Please sign in to comment.