Skip to content

Commit

Permalink
feat: adds D(), a shorthand for Dump().
Browse files Browse the repository at this point in the history
  • Loading branch information
atombender committed Oct 31, 2024
1 parent f2ba02b commit e50543c
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions dump.go
Original file line number Diff line number Diff line change
Expand Up @@ -471,12 +471,17 @@ func newDumpState(value reflect.Value, options *Options, writer io.Writer) *dump
return result
}

// Dump a value to stdout
// Dump a value to stdout.
func Dump(value ...interface{}) {
(&Config).Dump(value...)
}

// Sdump dumps a value to a string
// D dumps a value to stdout, and is a shorthand for [Dump].
func D(value ...interface{}) {
Dump(value...)
}

// Sdump dumps a value to a string.
func Sdump(value ...interface{}) string {
return (&Config).Sdump(value...)
}
Expand Down

0 comments on commit e50543c

Please sign in to comment.