Skip to content

Commit 932fb6d

Browse files
refactor: re-export FormatterOption for public SDK consumers
1 parent d0b37a4 commit 932fb6d

1 file changed

Lines changed: 4 additions & 5 deletions

File tree

‎pkg/sqlcmd/format.go‎

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -88,18 +88,17 @@ type sqlCmdFormatterType struct {
8888
rawErrors bool
8989
}
9090

91-
// formatterOption configures a Formatter returned by NewSQLCmdDefaultFormatter.
92-
// The type is unexported so options must come from helpers in this package.
93-
type formatterOption func(*sqlCmdFormatterType)
91+
// FormatterOption configures a Formatter returned by NewSQLCmdDefaultFormatter.
92+
type FormatterOption func(*sqlCmdFormatterType)
9493

9594
// WithRawErrors implements -j: when raw is true, AddError keeps the "mssql: "
9695
// prefix that go-mssqldb adds to error text instead of stripping it.
97-
func WithRawErrors(raw bool) formatterOption {
96+
func WithRawErrors(raw bool) FormatterOption {
9897
return func(f *sqlCmdFormatterType) { f.rawErrors = raw }
9998
}
10099

101100
// NewSQLCmdDefaultFormatter returns a Formatter that mimics the original ODBC-based sqlcmd formatter
102-
func NewSQLCmdDefaultFormatter(removeTrailingSpaces bool, ccb ControlCharacterBehavior, opts ...formatterOption) Formatter {
101+
func NewSQLCmdDefaultFormatter(removeTrailingSpaces bool, ccb ControlCharacterBehavior, opts ...FormatterOption) Formatter {
103102
f := &sqlCmdFormatterType{
104103
removeTrailingSpaces: removeTrailingSpaces,
105104
format: "horizontal",

0 commit comments

Comments
 (0)