diff --git a/pkg/format/g722.go b/pkg/format/g722.go index 9acfcae7..86d7d996 100644 --- a/pkg/format/g722.go +++ b/pkg/format/g722.go @@ -8,7 +8,12 @@ import ( // G722 is the RTP format for the G722 codec. // Specification: https://datatracker.ietf.org/doc/html/rfc3551 -type G722 struct{} +type G722 struct { + // in Go, empty structs share the same pointer, + // therefore they cannot be used as map keys + // or in equality operations. Prevent this. + unused int //nolint:unused +} func (f *G722) unmarshal(_ *unmarshalContext) error { return nil diff --git a/pkg/format/mjpeg.go b/pkg/format/mjpeg.go index c5b48c49..21275c69 100644 --- a/pkg/format/mjpeg.go +++ b/pkg/format/mjpeg.go @@ -8,7 +8,12 @@ import ( // MJPEG is the RTP format for the Motion-JPEG codec. // Specification: https://datatracker.ietf.org/doc/html/rfc2435 -type MJPEG struct{} +type MJPEG struct { + // in Go, empty structs share the same pointer, + // therefore they cannot be used as map keys + // or in equality operations. Prevent this. + unused int //nolint:unused +} func (f *MJPEG) unmarshal(_ *unmarshalContext) error { return nil diff --git a/pkg/format/mpeg1_audio.go b/pkg/format/mpeg1_audio.go index e37c1db4..603cde9e 100644 --- a/pkg/format/mpeg1_audio.go +++ b/pkg/format/mpeg1_audio.go @@ -8,7 +8,12 @@ import ( // MPEG1Audio is the RTP format for a MPEG-1/2 Audio codec. // Specification: https://datatracker.ietf.org/doc/html/rfc2250 -type MPEG1Audio struct{} +type MPEG1Audio struct { + // in Go, empty structs share the same pointer, + // therefore they cannot be used as map keys + // or in equality operations. Prevent this. + unused int //nolint:unused +} func (f *MPEG1Audio) unmarshal(_ *unmarshalContext) error { return nil diff --git a/pkg/format/mpeg1_video.go b/pkg/format/mpeg1_video.go index 04aac53d..93d4d158 100644 --- a/pkg/format/mpeg1_video.go +++ b/pkg/format/mpeg1_video.go @@ -8,7 +8,12 @@ import ( // MPEG1Video is the RTP format for a MPEG-1/2 Video codec. // Specification: https://datatracker.ietf.org/doc/html/rfc2250 -type MPEG1Video struct{} +type MPEG1Video struct { + // in Go, empty structs share the same pointer, + // therefore they cannot be used as map keys + // or in equality operations. Prevent this. + unused int //nolint:unused +} func (f *MPEG1Video) unmarshal(_ *unmarshalContext) error { return nil diff --git a/pkg/format/mpegts.go b/pkg/format/mpegts.go index 2913cafd..3baf5703 100644 --- a/pkg/format/mpegts.go +++ b/pkg/format/mpegts.go @@ -6,7 +6,12 @@ import ( // MPEGTS is the RTP format for MPEG-TS. // Specification: https://datatracker.ietf.org/doc/html/rfc2250 -type MPEGTS struct{} +type MPEGTS struct { + // in Go, empty structs share the same pointer, + // therefore they cannot be used as map keys + // or in equality operations. Prevent this. + unused int //nolint:unused +} func (f *MPEGTS) unmarshal(_ *unmarshalContext) error { return nil