samples

command
v0.9.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 23, 2023 License: MIT Imports: 10 Imported by: 0

README

Samples

Please play with the samples by editing them and running the main files:

  • main.go just a starter for different playgrounds
  • main-play.go general playground based on CopyFile and recursion
  • main-db-sample.go simulates DB transaction and money transfer
  • main-nil.go samples and tests for logger and using err2.Handle for success

Run a default playground play mode:

go run ./...

Or run the DB based version to maybe better understand how powerful the automatic error string building is:

go run ./... -mode db

You can print usage:

go run ./... -h

Documentation

Overview

Package main includes samples of err2. It works as a playground for users of the err2 package to test how different APIs work. We suggest you take your favorite editor and start to play with the main.go file. The comments on it guide you.

We have only a few examples built over the CopyFile and callRecur functions, but with them you can try all the important APIs from err2, try, and assert. Just follow the comments and try suggested things :-)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL