在Go中将字符串拆分为map的简单方法

I have such string:

"k1=v1; k2=v2; k3=v3"

Is there any simple way to make a map[string]string from it?

You will need to use a couple of calls to strings.Split():

s := "k1=v1; k2=v2; k3=v3"

entries := strings.Split(s, "; ")

m := make(map[string]string)
for _, e := range entries {
    parts := strings.Split(e, "=")
    m[parts[0]] = parts[1]
}

fmt.Println(m)

The first call will separate the different entries in the supplied string while the second will split the key/values apart. A working example can be found here.