Skip to content

Commit 7e13257

Browse files
committed
feat: adds D(), a shorthand for Dump().
1 parent f2ba02b commit 7e13257

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

dump.go

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -471,12 +471,17 @@ func newDumpState(value reflect.Value, options *Options, writer io.Writer) *dump
471471
return result
472472
}
473473

474-
// Dump a value to stdout
474+
// Dump a value to stdout.
475475
func Dump(value ...interface{}) {
476476
(&Config).Dump(value...)
477477
}
478478

479-
// Sdump dumps a value to a string
479+
// D dumps a value to stdout, and is a shorthand for [Dump].
480+
func D(value ...interface{}) {
481+
Dump(value...)
482+
}
483+
484+
// Sdump dumps a value to a string.
480485
func Sdump(value ...interface{}) string {
481486
return (&Config).Sdump(value...)
482487
}

0 commit comments

Comments
 (0)