1 00:00:13,530 --> 00:00:16,860 Hello and welcome to the Golang programming language course. 2 00:00:17,220 --> 00:00:24,840 In the previous session, we talked about if Alan function and in this session we want to talk about 3 00:00:24,840 --> 00:00:27,030 the other half empty package concept. 4 00:00:31,470 --> 00:00:33,090 Error is a function. 5 00:00:35,700 --> 00:00:43,740 The error, a function in good language, allow us use formatting features to create descriptive error 6 00:00:43,740 --> 00:00:44,520 messages. 7 00:00:45,240 --> 00:00:51,600 Error formats, according to the mentioned format, is it and assigns this format of this string to 8 00:00:51,600 --> 00:00:52,290 a variable. 9 00:00:52,860 --> 00:00:54,420 This is the error message. 10 00:00:54,780 --> 00:01:02,220 This function allows you to print customized error messages as per the user's veal and preened into 11 00:01:02,220 --> 00:01:04,260 council as an error message. 12 00:01:04,770 --> 00:01:08,910 Moreover, this function is defined under this empty package. 13 00:01:09,210 --> 00:01:14,370 Here, you'll need to import this empty package in order to use this function. 14 00:01:14,850 --> 00:01:17,070 Now you can see this syntax. 15 00:01:19,500 --> 00:01:24,720 Parameters, these function, access to parameters which are illustrated below. 16 00:01:26,050 --> 00:01:28,010 Format type is extreme. 17 00:01:28,300 --> 00:01:35,260 This is your error message with placeholder values such as per cent S. Forest Ring and person for an 18 00:01:35,260 --> 00:01:38,530 integer a three that interface. 19 00:01:38,860 --> 00:01:46,510 This is either constant variable name used in the code or any inbuilt function and return value. 20 00:01:46,720 --> 00:01:50,980 It returns the string as a value that satisfies a rule. 21 00:01:52,540 --> 00:01:58,840 Now, let's go to this school with program to illustrate the uses of it or if function. 22 00:02:00,850 --> 00:02:08,440 Now, calling it a function of impersonate the string formatting, which is used for printing extracts 23 00:02:09,820 --> 00:02:20,950 first define a variable like e r common equals from F A. Package B inward or F function and set the 24 00:02:20,950 --> 00:02:21,630 message. 25 00:02:22,030 --> 00:02:35,800 Arrows are cute at first and v lowercase and set time dot now. 26 00:02:39,130 --> 00:02:42,830 Now printing dare go to the next line. 27 00:02:42,860 --> 00:02:43,480 FP. 28 00:02:44,960 --> 00:02:47,180 And it all happened 29 00:02:51,200 --> 00:02:59,300 and set the raw message, reformat the code, save the project and execute the, you know. 30 00:03:02,160 --> 00:03:07,980 Now we can see the output, and it all happened around IQ and this time. 31 00:03:08,400 --> 00:03:11,790 Now we were able to get the variables value from using error. 32 00:03:11,790 --> 00:03:16,350 If function and preened, then we have reached the end of decision. 33 00:03:16,530 --> 00:03:20,970 I hope you have taken full advantage of decision onto next edition. 34 00:03:21,060 --> 00:03:21,690 Goodbye.