MCPcopy
hub / github.com/davyxu/tabtoy / StructTag

Method StructTag

v2/printer/golang.go:298–326  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

296}
297
298func (self *goFieldModel) StructTag() string {
299
300 var buf bytes.Buffer
301
302 buf.WriteString("`")
303
304 var userTagCount int
305
306 self.Meta.VisitUserMeta(func(k string, v interface{}) bool {
307
308 if userTagCount > 0 {
309 buf.WriteString(" ")
310 }
311
312 buf.WriteString(fmt.Sprintf("%s:\"%s\"", k, v))
313
314 userTagCount++
315
316 return true
317 })
318
319 buf.WriteString("`")
320
321 if userTagCount == 0 {
322 return ""
323 }
324
325 return buf.String()
326}
327
328func (self *goFieldModel) ElementTypeString() string {
329

Callers

nothing calls this directly

Calls 3

VisitUserMetaMethod · 0.80
WriteStringMethod · 0.45
StringMethod · 0.45

Tested by

no test coverage detected