1 00:00:14,600 --> 00:00:20,810 Hello and welcome to the Golang program language course in the previous session, we talked about sort 2 00:00:20,810 --> 00:00:25,460 map and in decision, we want to talk about the others map concept. 3 00:00:29,810 --> 00:00:35,690 TRUNCATE map, there are two methods to clear all items from a map. 4 00:00:36,870 --> 00:00:45,980 First, remove all keys via the falou and second define the make function for the existing map variables. 5 00:00:47,030 --> 00:00:51,290 Now, go to this school to illustrate how to truncate map. 6 00:00:54,250 --> 00:00:56,980 First, create a map and initialize it. 7 00:00:57,220 --> 00:01:02,380 My map, call it equals map. 8 00:01:05,410 --> 00:01:19,420 Said and as the index Typekit and said Estrange as a value target and initialize eight 10, Colin Keane, 9 00:01:21,700 --> 00:01:26,710 20, calling June 10 00:01:30,070 --> 00:01:32,920 30 Colin Alex 11 00:01:37,540 --> 00:01:44,170 now displayed a created map variable for index 12 00:01:46,870 --> 00:02:05,470 comma value column equals rearrange my map and this spelling by the comment if if index first sent the 13 00:02:06,200 --> 00:02:14,980 package city for a space between index and value value person. 14 00:02:15,190 --> 00:02:24,250 Yes, and I can stash and set index and value 15 00:02:27,670 --> 00:02:30,640 the format they call and say the project. 16 00:02:32,830 --> 00:02:38,680 Now we want to delete all keys by full loop and delete function. 17 00:02:40,570 --> 00:02:50,410 Go to the next line and Fold I column equals branch in my map 18 00:02:52,960 --> 00:02:54,610 and delete 19 00:02:57,130 --> 00:03:00,220 minor and set index. 20 00:03:00,670 --> 00:03:01,090 I 21 00:03:03,940 --> 00:03:10,060 now display my body will again be my map. 22 00:03:10,360 --> 00:03:13,210 After deleting. 23 00:03:16,000 --> 00:03:18,640 Go to the next line and see 24 00:03:21,100 --> 00:03:28,150 my map, reformat the code, save the project and execute the program. 25 00:03:30,670 --> 00:03:32,270 Now we can see the output. 26 00:03:32,290 --> 00:03:39,820 First, we display all elements of map and then truncate and display it, and we see on elements of 27 00:03:39,820 --> 00:03:41,410 Map Body that have deleted. 28 00:03:43,550 --> 00:03:51,980 In second method, we want to use make function to truncate the map barrier, but first clear the last 29 00:03:51,980 --> 00:03:52,520 code. 30 00:03:54,990 --> 00:04:02,450 And remove the delete function, create a very able and initialize it, display the elements of it. 31 00:04:03,520 --> 00:04:15,400 In this case, we said make function right hand of existing, my body in my map equals me function said 32 00:04:15,400 --> 00:04:18,670 eat as index and sit as string as value time. 33 00:04:18,700 --> 00:04:21,310 Save the project and execute the code again. 34 00:04:24,660 --> 00:04:32,190 Now we can see the output in this case also, we display all elements of math and then truncate map 35 00:04:32,210 --> 00:04:35,940 variation by the main function and display it. 36 00:04:36,240 --> 00:04:43,150 And we see all elements of map a bit have deleted in order not to prolong the time of decision. 37 00:04:43,170 --> 00:04:46,810 We will finish it and we will continue the content in the next session. 38 00:04:46,830 --> 00:04:47,370 Goodbye.