You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: coalescing_context.go
    path of file: ./repos/client/go/kbfs/libkbfs
    
    the code of the file until where you have to start completion: package libkbfs

import (
	"reflect"
	"sync"
	"time"

	"golang.org/x/net/context"
)

// CoalescingContext allows many contexts to be treated a
    
func (ctx *CoalescingContext) loop() {
	for {
		chosen, val, _ := reflect.Select(ctx.selects)
		switch chosen {
		case mutateChanSelectIndex:
			// request to mutate the select list
			newCase := val.Interface().(context.Context)
			if newCase != nil {
				ctx.appendContext(newCase)
			}
		case closeChanSelectIndex:
			// Done
			close(ctx.doneCh)
			return
		default:
			// The chosen channel has been closed. Remove it from our select list.
			ctx.selects = append(ctx.selects[:chosen], ctx.selects[chosen+1:]...)
			// If we have no more selects available, the request is done.
			if len(ctx.selects) == numExplicitlyHandledSelects {
				close(ctx.doneCh)
				return
			}
		}
	}
}