Commit 6092a2b9 authored by clabby's avatar clabby

Compile time checks for `ChannelOutApi` interface implementation

parent 5651672e
...@@ -50,6 +50,9 @@ type WriterApi interface { ...@@ -50,6 +50,9 @@ type WriterApi interface {
Write([]byte) (int, error) Write([]byte) (int, error)
} }
// Compile-time check for derive.ChannelOutApi interface implementation for the GarbageChannelOut type.
var _ derive.ChannelOutApi = (*GarbageChannelOut)(nil)
// GarbageChannelOut is a modified `derive.ChannelOut` that can be configured to behave differently // GarbageChannelOut is a modified `derive.ChannelOut` that can be configured to behave differently
// than the original // than the original
type GarbageChannelOut struct { type GarbageChannelOut struct {
......
...@@ -28,6 +28,9 @@ type ChannelOutApi interface { ...@@ -28,6 +28,9 @@ type ChannelOutApi interface {
OutputFrame(w *bytes.Buffer, maxSize uint64) error OutputFrame(w *bytes.Buffer, maxSize uint64) error
} }
// Compile-time check for ChannelOutApi interface implementation for the ChannelOut type.
var _ ChannelOutApi = (*ChannelOut)(nil)
type ChannelOut struct { type ChannelOut struct {
id ChannelID id ChannelID
// Frame ID of the next frame to emit. Increment after emitting // Frame ID of the next frame to emit. Increment after emitting
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment