Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Various improvements #4

Merged
merged 4 commits into from
Sep 28, 2021
Merged

Various improvements #4

merged 4 commits into from
Sep 28, 2021

Conversation

jb-abbadie
Copy link
Collaborator

No description provided.

@jb-abbadie jb-abbadie force-pushed the improvements branch 2 times, most recently from c4a69fb to 107355a Compare September 27, 2021 19:14
Copy link
Contributor

@Vince-Chenal Vince-Chenal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a little suggestion but OK for me

} else {
printInvalidTFVersion()
os.Exit(1)
tfversion := element.String()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would prefer it written this way to remove indentation levels

for _, element := range versions {
	if !constrains.Check(element) { // Validate a version against a constraint
		continue
	}

	tfversion := element.String()
	if !lib.ValidVersionFormat(tfversion) { // check if version format is correct
		printInvalidTFVersion()
		os.Exit(1)
	}
	
	out, err := lib.Install(tfversion, mirrorURL)
	if err != nil {
		log.Printf("Error during install %v", err)
		os.Exit(1)
	}
	return out
}

@jb-abbadie jb-abbadie merged commit 2497268 into main Sep 28, 2021
@jb-abbadie jb-abbadie deleted the improvements branch September 28, 2021 09:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants