(f reflect.StructField)
| 289 | } |
| 290 | |
| 291 | func (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 | } |