MCPcopy
hub / github.com/hwholiday/learning_tools / P

Method P

grpc/protoc-gen-hw/generator/generator.go:984–1000  ·  view source on GitHub ↗

P prints the arguments to the generated output. It handles strings and int32s, plus handling indirections because they may be *string, etc. Any inputs of type AnnotatedAtoms may emit annotations in a .meta file in addition to outputting the atoms themselves (if g.annotateCode is true).

(str ...interface{})

Source from the content-addressed store, hash-verified

982// annotations in a .meta file in addition to outputting the atoms themselves (if g.annotateCode
983// is true).
984func (g *Generator) P(str ...interface{}) {
985 if !g.writeOutput {
986 return
987 }
988 g.WriteString(g.indent)
989 for _, v := range str {
990 switch v := v.(type) {
991 case *AnnotatedAtoms:
992 for _, v := range v.atoms {
993 g.printAtom(v)
994 }
995 default:
996 g.printAtom(v)
997 }
998 }
999 g.WriteByte('\n')
1000}
1001
1002// addInitf stores the given statement to be printed inside the file's init function.
1003// The statement is given as a format specifier and arguments.

Callers 15

generateMethod · 0.95
generateHeaderMethod · 0.95
PrintCommentsMethod · 0.95
generateImportsMethod · 0.95
generateImportedMethod · 0.95
generateEnumMethod · 0.95
generateOneofFuncsMethod · 0.95
generateMessageStructMethod · 0.95
generateCommonMethodsMethod · 0.95
generateMessageMethod · 0.95

Calls 1

printAtomMethod · 0.95

Tested by

no test coverage detected