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

thoughts on code examples [err] #36

Open
TotallyNotAHaxxer opened this issue Apr 8, 2022 · 0 comments
Open

thoughts on code examples [err] #36

TotallyNotAHaxxer opened this issue Apr 8, 2022 · 0 comments

Comments

@TotallyNotAHaxxer
Copy link

was looking throuh some of the code files and i noticed you use

	if err != nil {
		log.Fatalln(err)
	}

in most samples, my thought on this is why not add modules? or a function in another module file to handel errors where the function looks similar to this

func CheckErr(err error, format string) {
                if err != nil {
                      if format == "log" {log.fatalln(err)}
                 }
}

and just advance the code from there, idk if thats just a me thing but i feel like it would be great to do in a sense of code optimization

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

No branches or pull requests

1 participant