Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GoCompiler: add kaitai.Struct interface support #294

Merged
merged 1 commit into from
Apr 1, 2024
Merged

Conversation

GreyCat
Copy link
Member

@GreyCat GreyCat commented Mar 29, 2024

This adds support for common interface kaitai.Struct in Go, akin to other KaitaiStruct ancestor classes (e.g. KaitaiStruct in Java).

Given that Go does not have inheritance, it provides the interface + makes sure that every single type we generate carries over this method:

func (this HelloWorld) IO_() *kaitai.Stream {
        return this._io
}

This does not change the status quo that for all internal communications KS expressions still use ._io, not .IO_(). That one we can address later.

To be merged after kaitai-io/kaitai_struct_go_runtime#30

Test check

Totals: 195 ran, 179 passed, 16 failed
SUMMARY: {"kst"=>183, "passed"=>179, "failed"=>16}

Comparison with previous: (no changes)

@GreyCat GreyCat merged commit fda00d3 into master Apr 1, 2024
3 of 6 checks passed
@generalmimon generalmimon deleted the go_kaitai_struct branch April 1, 2024 17:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant