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

Fd 1128 code hygiene #1129

Merged
merged 5 commits into from
Sep 30, 2021
Merged

Conversation

Nil425
Copy link
Contributor

@Nil425 Nil425 commented Sep 30, 2021

No description provided.

@Nil425 Nil425 marked this pull request as ready for review September 30, 2021 00:39
@PaulSnow PaulSnow merged commit d91e56b into FactomProject:develop Sep 30, 2021
@PaulSnow
Copy link
Contributor

Nil425 shadowed the developer stand up all summer, and took on a small code hygiene task.
Congratulations on your first commit to an open source project, and looking forward to many more from you!

@Emyrk
Copy link
Contributor

Emyrk commented Sep 30, 2021

@Nil425 Not that it really matters, but you can keep the 1 lines by catching the errors in an accumlator:

	var errs []error
	check := func(_ int, err error) {
		if err != nil {
			errs = append(errs, err)
		}
	}

        check(out.WriteString(fmt.Sprintf("\nFactomd Config")))
        check(out.WriteString(fmt.Sprintf("\n...")))
        check(out.WriteString(fmt.Sprintf("\n...")))

        if len(errs) > 0 {
                return "" // Or return some string that concats all the errors
        }
        return out.String()

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.

4 participants