Skip to content

Commit d081fde

Browse files
committed
more comment
1 parent a7d3a22 commit d081fde

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

media.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -217,9 +217,8 @@ func (s *WriteCloserSwitch[T]) Get() WriteCloser[T] {
217217

218218
// Swap sets an underlying writer and returns the old one.
219219
// Caller is responsible for closing the old writer.
220-
// If switch sample rate is unset, this locks the sample rate.
221-
// If sample rate is already locked, and the new writer does not
222-
// match it the code panics.
220+
// When switch sample rate is unset, it is set to the new writer's sample rate.
221+
// If sample rate is already set, this method panics on sample rate mismatch.
223222
func (s *WriteCloserSwitch[T]) Swap(w WriteCloser[T]) WriteCloser[T] {
224223
var old *WriteCloser[T]
225224
if w != nil {

0 commit comments

Comments
 (0)