---
title: "Discussion on \"Golang - Add Elements to one map position\" | Hashnode"
description: "Discussion on \"Golang - Add Elements to one map position\". // declare the hashMap\nvar hashMap = make(map[int][]string)\n\nhashMap[123] = []string{\"123\"}\n// adding elements to the HashMap\nhashMap[123] = append(hashMap[123], \"abc\")\nhashMap[123] = append(hashMap[123], \"456\")\n\nfmt.Println(hashMap)// map[123:[123 a..."
url: "https://hashnode.com/posts/golang-add-elements-to-one-map-position/65d475986daa1ab6ac500779"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Golang - Add Elements to one map position](https://luispuentes.hashnode.dev/golang-add-elements-to-one-map-position?utm_source=hashnode&utm_medium=feed)

// declare the hashMap var hashMap = make(map\[int\]\[\]string) hashMap\[123\] = \[\]string{"123"} // adding elements to the HashMap hashMap\[123\] = append(hashMap\[123\], "abc") hashMap\[123\] = append(hashMap\[123\], "456") fmt.Println(hashMap)// map\[123:\[123 a...

Feb 20, 2024 · 1 min read · luispuentes.hashnode.dev  
Read the article

-   [#go](https://hashnode.com/tag/go)
-   [#hashmap](https://hashnode.com/tag/hashmap)

## Written by

[Luis Puentes](https://hashnode.com/@luispuentes)

@luispuentes

  
[View profile](https://hashnode.com/@luispuentes)

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
