Skip to content

Commit

Permalink
edit: map / delete description added
Browse files Browse the repository at this point in the history
  • Loading branch information
ar-mokhtari committed Dec 3, 2022
1 parent 3c400ad commit 9de541f
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion content/chapter 1/1.8-map.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ func main() {
# عملیات CRUD روی مپ:
{{< tabs "myid" >}}
{{< tab "C : Create" >}}
برای ایجاد مپ، در قسمت [[#ایجاد و مقداردهی اولیه]] توضیح داده شده است.
برای ایجاد مپ، در قسمت [[#ایجاد و مقداردهی اولیه:]] توضیح داده شده است.
```go
package main

Expand Down Expand Up @@ -191,6 +191,17 @@ func main() {
fmt.Println(len(animals)) //4
}
```
{{< hint warning >}}
نکته: اگر کلید مورد استفاده در فانکشن `delete()` پیدا نشود، هیچ اتفاقی نخواهد افتاد.
علت عدم بازگشت ارور در فانکشن `delete()` است
````go
// The delete built-in function deletes the element with the specified key
// (m[key]) from the map. If m is nil or there is no such element, delete
// is a no-op.
func delete(m map[Type]Type1, key Type)

```
{{< /hint >}}
{{< /tab >}}
{{< /tabs>}}
`تکمیل و اصلاح می‌گردد`
Expand Down

0 comments on commit 9de541f

Please sign in to comment.