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: ahsai.go
    path of file: ./repos/ZeroBot-Plugin/plugin/ahsai
    
    the code of the file until where you have to start completion: // Package ahsai AH Soft フリーテキスト音声合成 demo API
package ahsai

import (
	"fmt"
	"math/rand"
	"os"
	"sort"
	"strconv"
	"time"

	"github.com/FloatTech/floatbox/file"
	ctrl "github.com/FloatTech/zbpctrl"
	"github.com/FloatTech/zbputils/control"
	ahsaitts "github.com/fumiama/ahsai"
	zero "github.com/wdvxdr1123/ZeroBot"
	"github.com/wdvxdr1123/ZeroBot/message"
)

var (
	namelist = [...]string{"伊織弓鶴", "紲星あかり"
    
func selectName(ctx *zero.Ctx) bool {
	regexMatched := ctx.State["regex_matched"].([]string)
	ctx.State["ahsaitext"] = regexMatched[2]
	name := regexMatched[1]
	index := sort.SearchStrings(namesort, name)
	if index < len(namelist) && namesort[index] == name {
		ctx.State["ahsainame"] = name
		return true
	}
	speaktext := ""
	for i, v := range namelist {
		speaktext += fmt.Sprintf("%d. %s\n", i, v)
	}
	ctx.SendChain(message.Text("输入的音源为空, 请输入音源序号\n", speaktext))
	next, cancel := zero.NewFutureEvent("message", 999, false, ctx.CheckSession(), zero.RegexRule(`\d{0,2}`)).Repeat()
	defer cancel()
	for {
		select {
		case <-time.After(time.Second * 10):
			ctx.State["ahsainame"] = namelist[rand.Intn(len(namelist))]
			ctx.SendChain(message.Text("时间太久啦！", zero.BotConfig.NickName[0], "帮你选择", ctx.State["ahsainame"]))
			return true
		case c := <-next:
			msg := c.Event.Message.ExtractPlainText()
			num, _ := strconv.Atoi(msg)
			if num < 0 || num >= len(namelist) {
				ctx.SendChain(message.Text("序号非法!"))
				continue
			}
			ctx.State["ahsainame"] = namelist[num]
			return true
		}
	}
}