MCPcopy Create free account
hub / github.com/Monibuca/engine / getFieldName

Method getFieldName

util/amf3.go:291–308  ·  view source on GitHub ↗
(f reflect.StructField)

Source from the content-addressed store, hash-verified

289}
290
291func (amf *AMF3) getFieldName(f reflect.StructField) string {
292 chars := []rune(f.Name)
293 if unicode.IsLower(chars[0]) {
294 return ""
295 }
296
297 name := f.Tag.Get("amf.name")
298 if name != "" {
299 return name
300 }
301
302 if !amf.reservStruct {
303 chars[0] = unicode.ToLower(chars[0])
304 return string(chars)
305 }
306
307 return f.Name
308}

Callers 1

MarshalMethod · 0.95

Calls 1

GetMethod · 0.45

Tested by

no test coverage detected