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: chat_cli_flag_utils.go
    path of file: ./repos/client/go/client
    
    the code of the file until where you have to start completion: // Copyright 2016 Keybase, Inc. All rights reserved. Use of
// this source code is governed by the included BSD license.

package client

import (
	"context"
	"errors"
	"fmt"
	"strings"

	"github.com/keybase/cli"
	"github.com/keybase/client/go/chat/globals"
	"github.com/keybase/client/go/chat/search"
	"github.com/keybase/client/go/chat/utils"
	"github.com/keybase/client/go/libkb"
	"github.com/keybase/client/go/protocol/chat1"
	"github.com/keybase/client/go/protocol/keybase1"
)

var chatFlags = map[string]cli.Flag{
	"topic-type": cli.StringFlag{
		Name:  "topic-type",
		Value: "chat",
		Usage: `Specify topic type of the conversation. Has to be chat or dev`,
	},
	"channel": cli.StringFlag{
		Name:  "channel",
		Usage: `Specify the conversation channel.`,
	},
	"set-channel": cli.StringFlag{
		Name:  "set-channel",
		Usage: `Rename a channel in a conversation`,
	},
	"set-headline": cli.StringFlag{
		Name:  "set-headline",
		Usage: `Set the headline for the conversation`,
	},
	"clear-headline": cli.BoolFlag{
		Name:
    
func annotateResolvingRequest2(g *libkb.GlobalContext, req *chatConversationResolvingRequest, setDefaultTeamTopic bool) (err error) {
	userOrTeamResult, err := CheckUserOrTeamName(context.TODO(), g, req.TlfName)
	if err != nil {
		return err
	}
	switch userOrTeamResult {
	case keybase1.UserOrTeamResult_USER:
		if g.Env.GetChatMemberType() == "impteam" {
			req.MembersType = chat1.ConversationMembersType_IMPTEAMNATIVE
		} else {
			req.MembersType = chat1.ConversationMembersType_KBFS
		}
	case keybase1.UserOrTeamResult_TEAM:
		req.MembersType = chat1.ConversationMembersType_TEAM
	}
	if req.TopicType == chat1.TopicType_CHAT && len(req.TopicName) != 0 &&
		req.MembersType != chat1.ConversationMembersType_TEAM {
		return errors.New("channel name only supported for team and dev conversations")
	}
	if setDefaultTeamTopic {
		// Set the default topic name to #general if none is specified
		if req.MembersType == chat1.ConversationMembersType_TEAM && len(req.TopicName) == 0 {
			req.TopicName = globals.DefaultTeamTopic
		}
	}
	return nil
}