1 00:00:15,330 --> 00:00:21,360 Hello and welcome to the goal and programming language course in the previous session, we talked about 2 00:00:21,360 --> 00:00:27,810 function with retired type and in decision, we want to talk about the others functions concept. 3 00:00:31,440 --> 00:00:33,360 Functions as values. 4 00:00:35,620 --> 00:00:43,090 Go programming language provides the flexibility to create functions on the fly and use them as values. 5 00:00:44,280 --> 00:00:49,050 In this case, we have initialized every ability to function definition. 6 00:00:49,380 --> 00:00:54,810 Now you can see the scene techs, it's time. 7 00:00:55,020 --> 00:01:00,270 Go to this good program to illustrate how to use go functions as values. 8 00:01:03,210 --> 00:01:07,290 Now, declare a function very, Bill, by the following code. 9 00:01:07,380 --> 00:01:12,270 First, create a variable and then initialize it by function. 10 00:01:16,170 --> 00:01:24,240 For the example, this quarter call in equals fun. 11 00:01:25,710 --> 00:01:32,520 Do not define function name and immediately set parameters in return time for the function. 12 00:01:32,760 --> 00:01:46,800 For the example, an X and type of it is float CC for as parameter and float 64 as return times 13 00:01:50,130 --> 00:01:52,710 now defined by the statement for function. 14 00:01:53,040 --> 00:02:01,650 For this case, purpose of this function variable is just to use in-built math dot escort function. 15 00:02:03,210 --> 00:02:07,530 Greeter Mess Package. 16 00:02:08,160 --> 00:02:09,350 Got this? 17 00:02:09,420 --> 00:02:15,060 Cue Archie and set the value in an X inside it. 18 00:02:16,950 --> 00:02:23,190 OK, now we could define it function and assign it to a variable like a square. 19 00:02:24,060 --> 00:02:29,820 Now go out of this square variable and display this variable value. 20 00:02:29,820 --> 00:02:36,810 For the example, if P invokes the variable, this color. 21 00:02:37,680 --> 00:02:45,540 And set a value for it, for example, nine, reformat the code and save the project and execute the 22 00:02:45,540 --> 00:02:45,960 code. 23 00:02:48,030 --> 00:02:50,040 Now we can see the output. 24 00:02:50,430 --> 00:02:53,010 We could define the function as a value. 25 00:02:53,370 --> 00:03:01,380 First, we define a variable and set the function inside it without need an invoke created variable 26 00:03:01,560 --> 00:03:08,880 and pass the floor 64 parameter to eat and fetch the result in order not to prolong the time of decision 27 00:03:08,880 --> 00:03:09,870 to be finished. 28 00:03:09,870 --> 00:03:12,840 And we will continue with the content in the next session. 29 00:03:13,050 --> 00:03:13,580 Goodbye.