MCPcopy
hub / github.com/tinylib/msgp / writeImportHeader

Function writeImportHeader

printer/print.go:132–143  ·  view source on GitHub ↗
(b *bytes.Buffer, imports ...string)

Source from the content-addressed store, hash-verified

130}
131
132func writeImportHeader(b *bytes.Buffer, imports ...string) {
133 b.WriteString("import (\n")
134 for _, im := range imports {
135 if im[len(im)-1] == '"' {
136 // support aliased imports
137 fmt.Fprintf(b, "\t%s\n", im)
138 } else {
139 fmt.Fprintf(b, "\t%q\n", im)
140 }
141 }
142 b.WriteString(")\n\n")
143}
144
145// generateFilePrefix creates a deterministic, unique prefix for constants based on the file name
146func generateFilePrefix(filename string) string {

Callers 1

generateFunction · 0.85

Calls 1

WriteStringMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…