Skip to content

Commit

Permalink
WithBuiltin FormatterOption added (#294)
Browse files Browse the repository at this point in the history
Co-authored-by: Roman A. Grigorovich <[email protected]>
  • Loading branch information
atzedus and Roman A. Grigorovich authored May 16, 2024
1 parent 59e3c3a commit 3c0d3ac
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions formatter/formatter.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,13 @@ func WithComments() FormatterOption {
}
}

// WithBuiltin includes builtin fields/directives/etc from the source/AST in the formatted output.
func WithBuiltin() FormatterOption {
return func(f *formatter) {
f.emitBuiltin = true
}
}

func NewFormatter(w io.Writer, options ...FormatterOption) Formatter {
f := &formatter{
indent: "\t",
Expand Down

0 comments on commit 3c0d3ac

Please sign in to comment.