MCPcopy Index your code
hub / github.com/google/gnostic / Print

Method Print

printer/code.go:31–39  ·  view source on GitHub ↗

Print adds a line of code using the current indentation. Accepts printf-style format strings and arguments.

(args ...interface{})

Source from the content-addressed store, hash-verified

29
30// Print adds a line of code using the current indentation. Accepts printf-style format strings and arguments.
31func (c *Code) Print(args ...interface{}) {
32 if len(args) > 0 {
33 for i := 0; i < c.indent; i++ {
34 c.text += indentation
35 }
36 c.text += fmt.Sprintf(args[0].(string), args[1:]...)
37 }
38 c.text += "\n"
39}
40
41// PrintIf adds a line of code using the current indentation if a condition is true. Accepts printf-style format strings and arguments.
42func (c *Code) PrintIf(condition bool, args ...interface{}) {

Callers 15

mainFunction · 0.95
generateProtoMethod · 0.95
GenerateCompilerMethod · 0.95
generateMainFileFunction · 0.95
printDocumentFunction · 0.80
printOperationFunction · 0.80
printSchemaFunction · 0.80
printVendorExtensionFunction · 0.80
printMessagesFunction · 0.80
printDocumentV2Function · 0.80
printDocumentV3Function · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected