Skip to content

Commit 9acffe9

Browse files
committed
Add support for ts.Silent()
1 parent 72a3fd8 commit 9acffe9

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

typescriptify/typescriptify.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ type TypeScriptify struct {
8989
CreateInterface bool
9090
CustomJsonTag string
9191
customImports []string
92+
silent bool
9293

9394
structTypes []StructType
9495
enumTypes []EnumType
@@ -164,7 +165,16 @@ func deepFields(typeOf reflect.Type) []reflect.StructField {
164165
return fields
165166
}
166167

168+
func (ts *TypeScriptify) Silent() *TypeScriptify {
169+
ts.silent = true
170+
return ts
171+
}
172+
167173
func (ts TypeScriptify) logf(depth int, s string, args ...interface{}) {
174+
if ts.silent {
175+
return
176+
}
177+
168178
fmt.Printf(strings.Repeat(" ", depth)+s+"\n", args...)
169179
}
170180

0 commit comments

Comments
 (0)