Discover Packages
github.com/facebookgo/subset
package
module
Version:
v0.0.0-...-c811ad8
Opens a new window with list of versions in this module.
Published: Feb 3, 2020
License: BSD-3-Clause
Opens a new window with license information.
Imports: 1
Opens a new window with list of imports.
Imported by: 10
Opens a new window with list of known importers.
README
Documentation
¶
Package subset implements logic to check if a value is a subset of
another using reflect.
func Assert(t Fatalf , expected interface{}, actual interface{})
Assert will fatal if not a subset with a useful message.
TODO should pretty print and show a colored side-by-side diff?
func Check(expected, target interface{}) bool
Check tests for deep subset. It uses normal == equality where
possible but will scan members of arrays, slices, maps, and fields of
structs. It correctly handles recursive types. Functions are equal
only if they are both nil.
type Fatalf interface {
Fatalf(format string , args ...interface{})
}
Fatalf is how our assertion will fail.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.