Since maps are reference types, functions can modify them directly:
func addEntry(m map[string]int, key string, value int) {
m[key] = value // modifies original map
}
ages := make(map[string]int)
addEntry(ages, "Alice", 30)
fmt.Println(ages["Alice"]) // 30
You don't need to return the map unless the function might need to handle a nil input by creating a new map.