Hello and welcome to the goal and programming language course in the previous session, we talked about
function with retired type and in decision, we want to talk about the others functions concept.
Functions as values.
Go programming language provides the flexibility to create functions on the fly and use them as values.
In this case, we have initialized every ability to function definition.
Now you can see the scene techs, it's time.
Go to this good program to illustrate how to use go functions as values.
Now, declare a function very, Bill, by the following code.
First, create a variable and then initialize it by function.
For the example, this quarter call in equals fun.
Do not define function name and immediately set parameters in return time for the function.
For the example, an X and type of it is float CC for as parameter and float 64 as return times
now defined by the statement for function.
For this case, purpose of this function variable is just to use in-built math dot escort function.
Greeter Mess Package.
Got this?
Cue Archie and set the value in an X inside it.
OK, now we could define it function and assign it to a variable like a square.
Now go out of this square variable and display this variable value.
For the example, if P invokes the variable, this color.
And set a value for it, for example, nine, reformat the code and save the project and execute the
code.
Now we can see the output.
We could define the function as a value.
First, we define a variable and set the function inside it without need an invoke created variable
and pass the floor 64 parameter to eat and fetch the result in order not to prolong the time of decision
to be finished.
And we will continue with the content in the next session.
Goodbye.