code: func QueryChannels(reqCtx reqContext.Context, peer fab.ProposalProcessor, opts ...Opt) (*pb.ChannelQueryResponse, error) {
  
  	if peer == nil {
  		return nil, errors.New("peer required")
  	}
  
  	optionsValue := getOpts(opts...)
  
  	cir := createChannelsInvokeRequest()
  	payload, err := queryChaincodeWithTarget(reqCtx, cir, peer, optionsValue)
  	if err != nil {
  		return nil, errors.WithMessage(err, "cscc.GetChannels failed")
  	}
  
  	response := new(pb.ChannelQueryResponse)
  	err = proto.Unmarshal(payload, response)
  	if err != nil {
  		return nil, errors.Wrap(err, "unmarshal ChannelQueryResponse failed")
  	}
  	return response, nil
  }
docs: // QueryChannels queries the names of all the channels that a peer has joined.