Implemented reading from struct fields

This commit is contained in:
Eduard Urbach 2025-02-04 20:43:15 +01:00
parent e36d9fade3
commit 71d7cdf5b2
Signed by: eduard
GPG key ID: 49226B848C78F6C8
10 changed files with 112 additions and 15 deletions

View file

@ -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
}