Implemented reading from struct fields
This commit is contained in:
@ -14,3 +14,13 @@ func (s *Struct) UniqueName() string {
|
||||
func (s *Struct) TotalSize() uint8 {
|
||||
return s.Size
|
||||
}
|
||||
|
||||
func (s *Struct) FieldByName(name string) *Field {
|
||||
for _, field := range s.Fields {
|
||||
if field.Name == name {
|
||||
return field
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
Reference in New Issue
Block a user