package
0.0.13
Repository: https://github.com/dyweb/gommon.git
Documentation: pkg.go.dev

# README

Test utilities

TODO

  • toc
  • example in go doc, can there be example for test package?

Condition

TODO: example of using test condition

Env

TODO: load dot env

Golden

TODO: use golden file

actually, just Read/WriteFixture would work ...

// GenGolden check if env GOLDEN or GEN_GOLDEN is set, sometimes you need to generate test fixture in test
func GenGolden() Condition {
	return Or(EnvHas("GOLDEN"), EnvHas("GEN_GOLDEN"))
}

# Functions

No description provided by the author
Bool checks if a bool is true.
BoolP checks if value of a pointer to bool is true.
No description provided by the author
Dump check if env DUMP or GOMMON_DUMP is set, so print detail or use go-spew to dump structs etc.
TODO: it's dump w/ Print in pretty.go ..
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
GenGolden check if env GOLDEN or GEN_GOLDEN is set, sometimes you need to generate test fixture in test.
GenGoldenT check if current test is manually set to generate golden file.
No description provided by the author
GOPATH returns build.Default.GOPATH https://stackoverflow.com/questions/32649770/how-to-get-current-gopath-from-code.
IsTravis check if env TRAVIS is true.
LoadDotEnv load .env in current directory into environment variable, line start with # are comments It is modeled after https://github.com/motdotla/dotenv.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
ReadYAMLToStrict uses strict mode when decoding, if unknown fields shows up in YAML but not in struct it will error.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author

# Interfaces

No description provided by the author