diff --git a/codes/go/pkg/print_utils.go b/codes/go/pkg/print_utils.go index 41a8ed26..3d9b83a2 100644 --- a/codes/go/pkg/print_utils.go +++ b/codes/go/pkg/print_utils.go @@ -97,9 +97,9 @@ func showTrunk(t *trunk) { fmt.Print(t.str) } -// PrintHashMap Print a hash map -func PrintMap(m map[int]string) { +// PrintMap Print a hash map +func PrintMap[K comparable, V any](m map[K]V) { for key, value := range m { - fmt.Printf("%d -> %s\n", key, value) + fmt.Println(key, "->", value) } } \ No newline at end of file