Implemented reading from struct fields
This commit is contained in:
parent
e36d9fade3
commit
71d7cdf5b2
10 changed files with 112 additions and 15 deletions
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue