是否可以在golang的包级别声明地图?

I want a make global map. I am trying the following

package main

import "fmt"

globalMap := make(map[string]string)

func main() {
    globalMap["a"] = "A"
    fmt.Println(globalMap)
}

It gives me following compilation error on line globalMap := make(map[string]string):

expected declaration, found 'IDENT' mas
non-declaration statement outside function body

Looking at the error i understand it won't allow me to create a global map. what could the best way to create a global map ?

Thanks.

You can’t use the := syntax outside a function body, but you can use the normal variable declaration syntax:

var globalMap = make(map[string]string)