Implemented struct size calculation after a scan
This commit is contained in:
parent
8fe663ece1
commit
162ddbefef
7 changed files with 48 additions and 24 deletions
17
src/types/Base.go
Normal file
17
src/types/Base.go
Normal file
|
@ -0,0 +1,17 @@
|
|||
package types
|
||||
|
||||
// Base is used to describe basic types like integers and floats.
|
||||
type Base struct {
|
||||
name string
|
||||
size int
|
||||
}
|
||||
|
||||
// Name returns the name of the type.
|
||||
func (s *Base) Name() string {
|
||||
return s.name
|
||||
}
|
||||
|
||||
// Size returns the total size in bytes.
|
||||
func (s *Base) Size() int {
|
||||
return s.size
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue