MCPcopy Create free account
hub / github.com/ZeppelinMC/Zeppelin / name

Function name

properties/encode.go:58–84  ·  view source on GitHub ↗
(tf reflect.StructField)

Source from the content-addressed store, hash-verified

56}
57
58func name(tf reflect.StructField) (n string, ok bool, omitempty bool) {
59 if !tf.IsExported() {
60 return "", false, false
61 }
62 name := tf.Name
63
64 propName, ok := tf.Tag.Lookup("properties")
65 if !ok {
66 return name, true, false
67 }
68 if propName == "-" {
69 return name, false, false
70 }
71 name = propName
72
73 i := strings.Index(name, ",omitempty")
74 if i == -1 {
75 return name, true, false
76 }
77
78 name = name[:i]
79 if name == "" {
80 name = tf.Name
81 }
82
83 return name, true, true
84}
85
86func writeString(w io.Writer, str string) error {
87 _, err := w.Write(unsafe.Slice(unsafe.StringData(str), len(str)))

Callers 1

encodePropsStructFunction · 0.70

Calls 1

LookupMethod · 0.80

Tested by

no test coverage detected