title
Golang Tutorial for Beginners | Full Go Course

description
Full Golang Tutorial to learn the Go Programming Language while building a simple CLI application In this full Golang course you will learn about one of the youngest programming languages that is becoming more and more popular in the cloud engineering world, which is Go or also commonly known as Golang. You will learn everything you need to get started with Go and start using it in your projects. We're going to write a very simple CLI application to learn the basics of Go. So instead of learning the concepts and syntax of Go with isolated examples, you will learn them while building an actual application throughout the tutorial. Before diving right into the syntax you will first understand why Go was even developed, its use cases or what Golang is used for and how Go is different from other programming languages. #golang #techworldwithnana ▬▬▬▬▬▬ L I N K S 🔗▬▬▬▬▬▬ Git Repo: ► https://gitlab.com/nanuchi/go-full-course-youtube Course Waitlist - Sign up to get notified: ► https://www.techworld-with-nana.com/course-roadmap ► This video is sponsored by Kasten 🙌🏼 ► Free Kubernetes Backup and Migration - Download Kasten's K10 and Get 10 nodes free forever: https://www.kasten.io/nana ▬▬▬▬▬▬ T I M E S T A M P S ⏰ ▬▬▬▬▬▬ 0:00 - Intro & Course Overview INTRODUCTION TO GO 02:47 - What is Go? Why Go? How it's different? 06:50 - Characteristics of Go and Go Use Cases GO SYNTAX & CONCEPTS 08:59 - Local Setup - Install Go & Editor 12:54 - Write our First Program & Structure of a Go File 22:02 - Variables & Constants in Go 30:43 - Formatted Output - printf 33:43 - Data Types in Go 45:18 - Getting User Input 47:19 - What is a Pointer? 53:55 - Book Ticket Logic 57:16 - Arrays & Slices 1:11:12 - Loops in Go 1:24:24 - Conditionals (if / else) and Boolean Data Type 1:39:33 - Validate User Input 1:54:02 - Switch Statement 1:58:37 - Encapsulate Logic with Functions 2:22:36 - Organize Code with Go Packages 2:35:39 - Scope Rules in Go 2:37:16 - Maps 2:53:20 - Structs 3:02:15 - Goroutines - Concurrency in Go 3:23:51 - Congratulations! ▬▬▬▬▬▬ Want to learn more? 🚀 ▬▬▬▬▬▬ Full Python course ► https://youtu.be/t8pPdKYpowI Full Docker course ► https://youtu.be/3c-iBn73dDE Full K8s course ► https://youtu.be/X48VuDVv0do DevOps Tools explained ► https://bit.ly/2W9UEq6 ▬▬▬▬▬▬ Connect with me 👋 ▬▬▬▬▬▬ INSTAGRAM ► https://bit.ly/2F3LXYJ TWITTER ► https://bit.ly/3i54PUB LINKEDIN ► https://bit.ly/3hWOLVT FB group ► https://bit.ly/32UVSZP DEV ► https://bit.ly/3h2fqiO ▬▬▬▬▬▬ Courses & Bootcamp & Ebooks 🚀 ▬▬▬▬▬▬ ► Become a DevOps Engineer - full educational program 👉🏼 https://bit.ly/45mXaer ► High-Quality and Hands-On Courses 👉🏼 https://bit.ly/3BNS8Kv ► Kubernetes 101 - compact and easy-to-read ebook bundle 👉🏼 https://bit.ly/3Ozl28x

detail
{'title': 'Golang Tutorial for Beginners | Full Go Course', 'heatmap': [{'end': 875.129, 'start': 737.917, 'weight': 0.841}, {'end': 2460.806, 'start': 2326.208, 'weight': 0.997}, {'end': 4308.17, 'start': 4053.028, 'weight': 0.874}, {'end': 8858.074, 'start': 8725.427, 'weight': 0.724}, {'end': 9352.187, 'start': 9223.549, 'weight': 0.777}], 'summary': 'A comprehensive go programming language course covering syntax, core concepts, parallel execution with go routines, user-friendly applications, using variables, constants, pointers, arrays, slices, managing user bookings, logic, user input validation, code organization, optimizing storage, using slices and structs, and working with concurrency and go routines.', 'chapters': [{'end': 139.017, 'segs': [{'end': 31.016, 'src': 'embed', 'start': 0.209, 'weight': 1, 'content': [{'end': 1.689, 'text': 'In this full course,', 'start': 0.209, 'duration': 1.48}, {'end': 9.992, 'text': 'you are going to learn about one of the youngest programming languages that is becoming more and more popular in the cloud engineering world,', 'start': 1.689, 'duration': 8.303}, {'end': 13.653, 'text': 'which is Go, or also commonly known as Golang.', 'start': 9.992, 'duration': 3.661}, {'end': 19.314, 'text': 'You will learn everything you need to get started with Go and start using it in your projects.', 'start': 14.253, 'duration': 5.061}, {'end': 22.675, 'text': "We're going to write a very simple CLI application.", 'start': 19.814, 'duration': 2.861}, {'end': 24.915, 'text': 'to learn the basics of Go.', 'start': 23.135, 'duration': 1.78}, {'end': 31.016, 'text': 'So, instead of learning the concepts and syntax of Go with isolated examples,', 'start': 25.335, 'duration': 5.681}], 'summary': 'Learn about the popular programming language go, including basics and application development.', 'duration': 30.807, 'max_score': 0.209, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/yyUHQIec83I/pics/yyUHQIec83I209.jpg'}, {'end': 122.754, 'src': 'embed', 'start': 76.384, 'weight': 0, 'content': [{'end': 86.232, 'text': 'You will also learn about variables and constants, about formatted output getting and validating user inputs, a concept of pointers in Go,', 'start': 76.384, 'duration': 9.848}, {'end': 88.234, 'text': 'as well as variable scopes.', 'start': 86.232, 'duration': 2.002}, {'end': 99.282, 'text': 'Then you will see how to control the application flow with loops, if-else and switch statements, as well as how to encapsulate logic in functions and,', 'start': 88.775, 'duration': 10.507}, {'end': 102.365, 'text': 'generally, how to organize your code in Go packages.', 'start': 99.282, 'duration': 3.083}, {'end': 111.291, 'text': 'Finally, we will make use of Go routines to parallelize some of the execution to make our application faster with concurrency.', 'start': 102.945, 'duration': 8.346}, {'end': 114.493, 'text': "So we're going to learn a lot of things in this course.", 'start': 111.871, 'duration': 2.622}, {'end': 116.593, 'text': 'And I hope you are excited to get started.', 'start': 114.853, 'duration': 1.74}, {'end': 122.754, 'text': 'Also, I want to mention that all the demo code from this course is available in a Git repository,', 'start': 117.133, 'duration': 5.621}], 'summary': 'Learn about variables, loops, functions, and concurrency in go programming.', 'duration': 46.37, 'max_score': 76.384, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/yyUHQIec83I/pics/yyUHQIec83I76384.jpg'}], 'start': 0.209, 'title': 'Learning go programming language', 'summary': 'Covers a comprehensive course on learning go programming language, including building a simple cli application, understanding basics, syntax, core concepts, and parallel execution with go routines.', 'chapters': [{'end': 139.017, 'start': 0.209, 'title': 'Learning go programming language', 'summary': 'Covers a comprehensive course on learning go programming language, focusing on building a simple cli application, understanding the basics, syntax, core concepts, and parallel execution with go routines.', 'duration': 138.808, 'highlights': ['The course covers learning the basics of Go through building a simple CLI application, including understanding the syntax, core concepts, and setting up the development environment.', 'Topics include learning about data types, variables, constants, formatted output, user input validation, pointers, variable scopes, control flow with loops, if-else and switch statements, organizing code in Go packages, and using Go routines for parallel execution.', 'The demo code from the course is available in a Git repository linked in the video description for easy follow-along.']}], 'duration': 138.808, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/yyUHQIec83I/pics/yyUHQIec83I209.jpg', 'highlights': ['Topics include learning about data types, variables, constants, formatted output, user input validation, pointers, variable scopes, control flow with loops, if-else and switch statements, organizing code in Go packages, and using Go routines for parallel execution.', 'The course covers learning the basics of Go through building a simple CLI application, including understanding the syntax, core concepts, and setting up the development environment.', 'The demo code from the course is available in a Git repository linked in the video description for easy follow-along.']}, {'end': 1269.223, 'segs': [{'end': 248.103, 'src': 'embed', 'start': 218.503, 'weight': 0, 'content': [{'end': 223.567, 'text': 'So infrastructure became much more scalable, dynamic, and had more capacity.', 'start': 218.503, 'duration': 5.064}, {'end': 232.092, 'text': "However, most languages couldn't help in writing applications that would take advantage of these infrastructure improvements.", 'start': 224.167, 'duration': 7.925}, {'end': 238.317, 'text': 'So basically, you had applications that would just execute one task at a time in order.', 'start': 232.513, 'duration': 5.804}, {'end': 248.103, 'text': 'But with infrastructure improvements, it was possible to now write applications that would execute tasks in parallel, do multiple things at once,', 'start': 238.537, 'duration': 9.566}], 'summary': 'Infrastructure became more scalable and dynamic, enabling parallel task execution.', 'duration': 29.6, 'max_score': 218.503, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/yyUHQIec83I/pics/yyUHQIec83I218503.jpg'}, {'end': 425.743, 'src': 'embed', 'start': 395.815, 'weight': 1, 'content': [{'end': 402.561, 'text': 'is writing applications that need to be very performant and will run on the modern,', 'start': 395.815, 'duration': 6.746}, {'end': 409.948, 'text': 'scaled and distributed infrastructure with hundreds and thousands of servers, typically on a cloud platform.', 'start': 402.561, 'duration': 7.387}, {'end': 414.42, 'text': 'For developing Go,', 'start': 413.26, 'duration': 1.16}, {'end': 425.743, 'text': 'they wanted to take the simplicity of syntax of a more high level language like Python and the speed and efficiency of a lower level language like C++.', 'start': 414.42, 'duration': 11.323}], 'summary': "Developing performant applications in go for modern, scaled, and distributed infrastructure with hundreds and thousands of servers on a cloud platform, combining the simplicity of python's syntax with the speed and efficiency of c++.", 'duration': 29.928, 'max_score': 395.815, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/yyUHQIec83I/pics/yyUHQIec83I395815.jpg'}, {'end': 526.953, 'src': 'embed', 'start': 495.422, 'weight': 2, 'content': [{'end': 499.905, 'text': 'and you can deploy it and run it on different platforms in a consistent way.', 'start': 495.422, 'duration': 4.483}, {'end': 508.852, 'text': "So no matter which operating system or which environment you're using, you can take that same binary and basically use it across different platforms.", 'start': 500.265, 'duration': 8.587}, {'end': 518.88, 'text': 'So, considering all these benefits of simplicity and speed and so on, Go is becoming more and more popular for writing,', 'start': 509.433, 'duration': 9.447}, {'end': 526.953, 'text': 'simple automation applications and command line interface applications for DevOps and SRE tasks as well.', 'start': 518.88, 'duration': 8.073}], 'summary': 'Go is gaining popularity for writing simple automation and cli applications due to its cross-platform consistency and speed.', 'duration': 31.531, 'max_score': 495.422, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/yyUHQIec83I/pics/yyUHQIec83I495422.jpg'}, {'end': 875.129, 'src': 'heatmap', 'start': 737.917, 'weight': 0.841, 'content': [{'end': 741.759, 'text': 'And on the left side right here, you have the extensions tab.', 'start': 737.917, 'duration': 3.842}, {'end': 750.982, 'text': 'So if I click inside and then search Go, it will give us all the available extensions for Visual Studio Code.', 'start': 742.319, 'duration': 8.663}, {'end': 755.884, 'text': 'And the first one with the most downloads is the official one from Go team at Google.', 'start': 751.362, 'duration': 4.522}, {'end': 760.976, 'text': 'And You also have a description of what that extension gives you.', 'start': 756.564, 'duration': 4.412}, {'end': 762.978, 'text': "And that's the extension we're going to use.", 'start': 761.437, 'duration': 1.541}, {'end': 766.221, 'text': "So click on install and that's it.", 'start': 763.158, 'duration': 3.063}, {'end': 773.048, 'text': "Now we're all set up to start writing our first go application in Visual Studio code.", 'start': 766.742, 'duration': 6.306}, {'end': 778.959, 'text': 'And for that, obviously, we need to create a file.', 'start': 776.897, 'duration': 2.062}, {'end': 784.004, 'text': 'And this is going to be a main.go file with .go extension.', 'start': 779.479, 'duration': 4.525}, {'end': 788.308, 'text': 'You will see a bunch of pop ups here to install things for the go extension.', 'start': 784.564, 'duration': 3.744}, {'end': 794.133, 'text': 'So go ahead and click on install all and that will install and set up the rest of the stuff.', 'start': 788.748, 'duration': 5.385}, {'end': 802.781, 'text': 'And main.go is basically a standard name for the main file where the go application code is written.', 'start': 795.314, 'duration': 7.467}, {'end': 809.675, 'text': 'And to see that in the file explorer we have this booking app folder and inside we have this main.go file.', 'start': 803.513, 'duration': 6.162}, {'end': 817.878, 'text': 'Now how do we start writing code in Go? Like printing a simple hello world message to the console.', 'start': 810.676, 'duration': 7.202}, {'end': 824.001, 'text': "Let's do print quotes hello world.", 'start': 819.199, 'duration': 4.802}, {'end': 832.392, 'text': "And we already see the first benefit of a Go extension because it tells us that this code doesn't work.", 'start': 825.421, 'duration': 6.971}, {'end': 838.737, 'text': "And as you see, the error says that Go can't find a file called Go.mod.", 'start': 833.092, 'duration': 5.645}, {'end': 844.222, 'text': 'So the first thing we need to fix is to make our Go application into a project.', 'start': 839.358, 'duration': 4.864}, {'end': 847.525, 'text': 'And for that, we need to basically initialize it.', 'start': 844.963, 'duration': 2.562}, {'end': 849.687, 'text': "That's the error that we get here.", 'start': 848.386, 'duration': 1.301}, {'end': 857.614, 'text': "And to do that, we're going to open a terminal in Visual Studio Code, a new terminal window,", 'start': 850.307, 'duration': 7.307}, {'end': 865.227, 'text': "and This will give us terminal in booking a folder which we're in, which is very convenient.", 'start': 857.614, 'duration': 7.613}, {'end': 875.129, 'text': "And here I'm going to run a go command called Go Mod or module in it and basically name of the project.", 'start': 865.767, 'duration': 9.362}], 'summary': 'Setting up and using the go extension in visual studio code for writing a go application, initializing the project with go mod.', 'duration': 137.212, 'max_score': 737.917, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/yyUHQIec83I/pics/yyUHQIec83I737917.jpg'}, {'end': 1037.948, 'src': 'embed', 'start': 1008.236, 'weight': 3, 'content': [{'end': 1009.597, 'text': 'where the execution starts.', 'start': 1008.236, 'duration': 1.361}, {'end': 1016.722, 'text': 'And the entry point is a main function that Go will look for whenever you execute your Go application.', 'start': 1010.137, 'duration': 6.585}, {'end': 1023.064, 'text': 'And we create a main function using funk keyword, name of the function.', 'start': 1017.382, 'duration': 5.682}, {'end': 1025.565, 'text': 'Again, it has to be called main.', 'start': 1023.444, 'duration': 2.121}, {'end': 1033.607, 'text': 'And we have to put our logic, whatever we are executing within that main function.', 'start': 1026.925, 'duration': 6.682}, {'end': 1037.948, 'text': 'So now Go will know where to start executing our application.', 'start': 1033.906, 'duration': 4.042}], 'summary': 'Go applications start execution at the main function using the funk keyword and logic within it.', 'duration': 29.712, 'max_score': 1008.236, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/yyUHQIec83I/pics/yyUHQIec83I1008236.jpg'}, {'end': 1108.394, 'src': 'embed', 'start': 1083.291, 'weight': 4, 'content': [{'end': 1089.032, 'text': "and we have to explicitly import any packages from which we're using the functionality.", 'start': 1083.291, 'duration': 5.741}, {'end': 1099.275, 'text': "So we're going to do import quotes fmt that's the name of the Go package and to use a print function or any function from the package,", 'start': 1089.352, 'duration': 9.923}, {'end': 1103.612, 'text': "we're going to do fmt.print.", 'start': 1100.33, 'duration': 3.282}, {'end': 1108.394, 'text': 'And immediately, as you see, the error is gone.', 'start': 1104.752, 'duration': 3.642}], 'summary': 'In go, to use a print function from the fmt package, import it explicitly. error resolved.', 'duration': 25.103, 'max_score': 1083.291, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/yyUHQIec83I/pics/yyUHQIec83I1083291.jpg'}, {'end': 1239.76, 'src': 'embed', 'start': 1209.781, 'weight': 5, 'content': [{'end': 1216.264, 'text': "So let's clean up our terminal and executing a Go application is very easy.", 'start': 1209.781, 'duration': 6.483}, {'end': 1225.648, 'text': 'We have Go command for it called Go run and name of the file that we are executing, which is main.go.', 'start': 1216.884, 'duration': 8.764}, {'end': 1230.19, 'text': 'So Go run will basically execute this file.', 'start': 1226.189, 'duration': 4.001}, {'end': 1233.412, 'text': 'It will look for the main function.', 'start': 1230.931, 'duration': 2.481}, {'end': 1239.76, 'text': 'and execute the contents or lines within that function one by one.', 'start': 1234.093, 'duration': 5.667}], 'summary': 'Executing a go application using the go run command is simple, as it looks for the main function in the specified file (main.go) and executes its contents.', 'duration': 29.979, 'max_score': 1209.781, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/yyUHQIec83I/pics/yyUHQIec83I1209781.jpg'}], 'start': 139.737, 'title': 'Go programming language', 'summary': "Explores the motivation behind creating the go programming language for scalable infrastructure, parallel task execution, and user-friendly applications. it also highlights go's suitability for writing performant applications in modern, distributed infrastructures, with popular use cases in cloud technologies, and explains the entry point in a go application and the necessity of importing packages.", 'chapters': [{'end': 354.305, 'start': 139.737, 'title': 'Go programming language: motivation and usage', 'summary': 'Explores the motivation behind creating the go programming language by addressing the need for applications to take advantage of scalable infrastructure and execute tasks in parallel, making them faster and more user-friendly.', 'duration': 214.568, 'highlights': ['The infrastructure where applications were deployed changed with the rise of multi-core processors and cloud infrastructure, requiring applications to execute tasks in parallel for faster performance. multi-core processors, cloud infrastructure', 'Examples of parallel execution include Google Drive allowing uploading, downloading, and UI navigation simultaneously, as well as YouTube enabling users to listen, comment, like, and scroll concurrently. examples of parallel execution', 'The concept of concurrency, which involves preventing conflicts between tasks when multiple tasks are running in parallel and updating the same data, needs to be handled by developers in code. concurrency, preventing conflicts', 'The Go programming language was created to address the need for writing applications that can take advantage of scalable infrastructure improvements and execute tasks in parallel for improved performance. motivation for creating Go language']}, {'end': 980.139, 'start': 354.685, 'title': 'Go: concurrency and performance', 'summary': 'Highlights the main purpose and advantages of go, emphasizing its suitability for writing performant applications for modern, distributed infrastructures, with popular use cases in cloud technologies. it also covers the setup and initialization process of a go project, including installing necessary software and resolving common errors.', 'duration': 625.454, 'highlights': ['Go is designed for writing multithreaded concurrent applications for modern, distributed infrastructures, with popular use cases in cloud technologies such as Docker, HashiCorp, Vault Kubernetes, and CockroachDB. Go is best used for writing performant applications that will run on modern, scaled, and distributed infrastructure with hundreds and thousands of servers, typically on a cloud platform. Many cloud technologies are written in Go, including Docker, HashiCorp, Vault Kubernetes, and CockroachDB.', 'Go offers advantages such as simple syntax, fast application building and execution, resource efficiency, and cross-platform deployment with a single binary. Go applications have a simple syntax, can be built and executed quickly, are resource efficient, and can be deployed on different platforms using a single binary, making it highly maintainable and extendable.', 'The process of setting up and initializing a Go project involves installing the Go compiler and an integrated development environment (IDE) like Visual Studio Code, as well as resolving common errors related to initializing a Go application into a project. Setting up a Go project involves installing the Go compiler and an IDE like Visual Studio Code, resolving common errors related to initializing a Go application into a project, and creating a main.go file as the standard file for writing Go application code.']}, {'end': 1269.223, 'start': 980.719, 'title': 'Go application entry point and package usage', 'summary': 'Explains the importance of declaring an entry point in a go application, specifically the main function, as well as the necessity of importing packages for using their functionalities, with examples and details on how to execute a go application.', 'duration': 288.504, 'highlights': ['Go applications require the main function as the entry point for execution, allowing only one entry point per application. Emphasizes the significance of the main function as the entry point for Go applications, limiting to one entry point per application.', 'Importing packages, such as fmt for print functionality, is essential to access built-in Go functionalities, requiring explicit import statements for usage. Highlights the necessity of importing packages like fmt for accessing built-in functionalities in Go, requiring explicit import statements for usage.', 'Explanation on the organization of functionalities into packages in Go and the availability of built-in packages for various functionalities. Details the organization of functionalities into packages in Go and the availability of built-in packages for various functionalities.', "Instructions on executing a Go application using the 'Go run' command and an example of adding a new line at the end of a print statement using the 'print ln' function. Provides instructions for executing a Go application using the 'Go run' command and demonstrates adding a new line at the end of a print statement using the 'print ln' function."]}], 'duration': 1129.486, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/yyUHQIec83I/pics/yyUHQIec83I139737.jpg', 'highlights': ['Go programming language created to address need for scalable infrastructure improvements and parallel task execution.', 'Go designed for writing multithreaded concurrent applications for modern, distributed infrastructures.', 'Go applications have simple syntax, fast building and execution, resource efficiency, and cross-platform deployment.', 'Main function serves as entry point for Go applications, allowing only one entry point per application.', 'Importing packages like fmt for accessing built-in functionalities in Go is essential, requiring explicit import statements for usage.', "Instructions for executing a Go application using the 'Go run' command and adding a new line at the end of a print statement."]}, {'end': 2655.795, 'segs': [{'end': 1294.111, 'src': 'embed', 'start': 1269.863, 'weight': 0, 'content': [{'end': 1278.586, 'text': "Now that we have the minimum program structure and know how to run Go programs let's start writing our booking application logic.", 'start': 1269.863, 'duration': 8.723}, {'end': 1287.089, 'text': 'The very first thing we need to do in our booking application is to greet our users when they visit the application.', 'start': 1279.106, 'duration': 7.983}, {'end': 1294.111, 'text': "So let's write some welcome message and information about the conference for which they are booking the tickets.", 'start': 1287.669, 'duration': 6.442}], 'summary': 'Developing a booking application with a focus on greeting users and providing conference details.', 'duration': 24.248, 'max_score': 1269.863, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/yyUHQIec83I/pics/yyUHQIec83I1269863.jpg'}, {'end': 1429.184, 'src': 'embed', 'start': 1374.107, 'weight': 1, 'content': [{'end': 1378.848, 'text': "but you can simply change it in one place where you assigned it to a variable, and that's it.", 'start': 1374.107, 'duration': 4.741}, {'end': 1388.63, 'text': 'So how do we create and use variables in Go? Well, we have the value like the name of the conference.', 'start': 1379.548, 'duration': 9.082}, {'end': 1391.271, 'text': "Let's call it Go Conference.", 'start': 1389.09, 'duration': 2.181}, {'end': 1399.233, 'text': 'And we store that value in a variable and we can give that variable whatever name we want like this.', 'start': 1392.391, 'duration': 6.842}, {'end': 1400.653, 'text': "Let's call it a name.", 'start': 1399.813, 'duration': 0.84}, {'end': 1408.051, 'text': "And finally we tell go that we're creating a variable using a VAR keyword.", 'start': 1401.548, 'duration': 6.503}, {'end': 1415.675, 'text': 'So this basically lets us store the value go conference the conference name in a variable called name.', 'start': 1408.691, 'duration': 6.984}, {'end': 1422.198, 'text': 'So now we can use that value by referencing the variable name wherever we need it.', 'start': 1415.895, 'duration': 6.303}, {'end': 1429.184, 'text': "Now with variables, it's a good practice to create variable names that properly describe what the value is.", 'start': 1422.998, 'duration': 6.186}], 'summary': "In go, variables are created using 'var' keyword, allowing easy value referencing.", 'duration': 55.077, 'max_score': 1374.107, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/yyUHQIec83I/pics/yyUHQIec83I1374107.jpg'}, {'end': 1659.583, 'src': 'embed', 'start': 1634.897, 'weight': 3, 'content': [{'end': 1641.384, 'text': 'We have 50 conference tickets and it will always stay 50 while our application is running.', 'start': 1634.897, 'duration': 6.487}, {'end': 1646.269, 'text': 'and for such values that do not change or stay constant.', 'start': 1641.744, 'duration': 4.525}, {'end': 1649.673, 'text': 'instead of variables we have constants.', 'start': 1646.269, 'duration': 3.404}, {'end': 1656.059, 'text': "now, as you might think, the conference name could also be a constant, because it also doesn't change throughout the program,", 'start': 1649.673, 'duration': 6.386}, {'end': 1659.583, 'text': 'but for this example we will leave it as a variable.', 'start': 1656.059, 'duration': 3.524}], 'summary': 'The application has 50 constant conference tickets.', 'duration': 24.686, 'max_score': 1634.897, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/yyUHQIec83I/pics/yyUHQIec83I1634897.jpg'}, {'end': 1771.104, 'src': 'embed', 'start': 1743.938, 'weight': 4, 'content': [{'end': 1749.664, 'text': "And for tracking that amount, we're going to create another variable for remaining tickets.", 'start': 1743.938, 'duration': 5.726}, {'end': 1754.629, 'text': "And we're going to call it remaining tickets.", 'start': 1752.807, 'duration': 1.822}, {'end': 1763.339, 'text': 'which again is a variable because as users book their tickets, this value will get less and less.', 'start': 1756.294, 'duration': 7.045}, {'end': 1767.962, 'text': "And it starts at 50 because that's how many tickets we have in total.", 'start': 1763.839, 'duration': 4.123}, {'end': 1771.104, 'text': "And again, we have this warning because we're not using it.", 'start': 1768.522, 'duration': 2.582}], 'summary': "Create a variable 'remaining tickets' starting at 50 for tracking ticket availability.", 'duration': 27.166, 'max_score': 1743.938, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/yyUHQIec83I/pics/yyUHQIec83I1743938.jpg'}, {'end': 1871.724, 'src': 'embed', 'start': 1843.755, 'weight': 5, 'content': [{'end': 1852.763, 'text': "Now, whenever we're printing our text mixed with variables, we can use a function called printf from the format package.", 'start': 1843.755, 'duration': 9.008}, {'end': 1857.567, 'text': 'This function is specifically used for printing formatted data.', 'start': 1853.244, 'duration': 4.323}, {'end': 1862.581, 'text': 'So it tells Go how to format the values of the variables.', 'start': 1858.499, 'duration': 4.082}, {'end': 1867.103, 'text': 'And generally, it makes writing these kind of outputs easier.', 'start': 1863.141, 'duration': 3.962}, {'end': 1871.724, 'text': 'So with printf, this line, for example, will look like this.', 'start': 1867.683, 'duration': 4.041}], 'summary': 'Using printf function from format package makes formatted data printing easier.', 'duration': 27.969, 'max_score': 1843.755, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/yyUHQIec83I/pics/yyUHQIec83I1843755.jpg'}, {'end': 2153.627, 'src': 'embed', 'start': 2126.045, 'weight': 6, 'content': [{'end': 2136.229, 'text': 'Well, in Go all values have data types and generally, in any programming language, you have multiple data types for different use cases,', 'start': 2126.045, 'duration': 10.184}, {'end': 2137.77, 'text': "and Go isn't an exception.", 'start': 2136.229, 'duration': 1.541}, {'end': 2144.477, 'text': 'The difference between these languages is, however, which data types exactly they support.', 'start': 2138.63, 'duration': 5.847}, {'end': 2148.201, 'text': 'So each language has its own set of data types.', 'start': 2144.857, 'duration': 3.344}, {'end': 2153.627, 'text': 'Two most basic and common data types are strings and integers.', 'start': 2149.162, 'duration': 4.465}], 'summary': 'Go supports various data types including strings and integers.', 'duration': 27.582, 'max_score': 2126.045, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/yyUHQIec83I/pics/yyUHQIec83I2126045.jpg'}, {'end': 2238.737, 'src': 'embed', 'start': 2209.8, 'weight': 9, 'content': [{'end': 2219.025, 'text': 'So the main purpose of having types for values in code is to avoid accidentally using an integer as a string or vice versa,', 'start': 2209.8, 'duration': 9.225}, {'end': 2224.027, 'text': 'and use one data type instead of the other, which may break your application.', 'start': 2219.025, 'duration': 5.002}, {'end': 2227.789, 'text': 'So when we create variables in Go, it needs a type.', 'start': 2224.847, 'duration': 2.942}, {'end': 2238.737, 'text': "Now, you may be thinking when we created these two variables right here, these two variables and a constant, we didn't specify a type.", 'start': 2228.35, 'duration': 10.387}], 'summary': 'Using types in code helps avoid errors and breakages. in go, variables need a type.', 'duration': 28.937, 'max_score': 2209.8, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/yyUHQIec83I/pics/yyUHQIec83I2209800.jpg'}, {'end': 2460.806, 'src': 'heatmap', 'start': 2326.208, 'weight': 0.997, 'content': [{'end': 2339.02, 'text': "And in the print statement with printf, we're going to say user, whatever their username, booked this many tickets.", 'start': 2326.208, 'duration': 12.812}, {'end': 2347.674, 'text': 'and reference the respective variables.', 'start': 2344.392, 'duration': 3.282}, {'end': 2350.736, 'text': "And again, let's run this.", 'start': 2348.234, 'duration': 2.502}, {'end': 2354.218, 'text': 'And here we have our output.', 'start': 2351.676, 'duration': 2.542}, {'end': 2361.922, 'text': 'Now you probably already noticed something really cool about Go, especially if you have worked with other programming languages before.', 'start': 2354.718, 'duration': 7.204}, {'end': 2371.885, 'text': "And that is that, while we're writing this code, if we make some mistakes, if we have errors in our code for example,", 'start': 2362.382, 'duration': 9.503}, {'end': 2382.209, 'text': 'defining a variable and not using it, or forgetting to specify a type, et cetera Go basically detects those errors before we even run the application.', 'start': 2371.885, 'duration': 10.324}, {'end': 2387.671, 'text': "So by the time we're ready to execute the application, we have fixed a bunch of errors.", 'start': 2382.509, 'duration': 5.162}, {'end': 2392.355, 'text': 'that Go identified and highlighted for us.', 'start': 2388.371, 'duration': 3.984}, {'end': 2395.398, 'text': "In many programming languages, that's not the case.", 'start': 2393.016, 'duration': 2.382}, {'end': 2402.365, 'text': "Usually, you discover these kind of errors when you run the application, not while you're coding.", 'start': 2395.899, 'duration': 6.466}, {'end': 2404.828, 'text': 'And that is a big advantage of Go.', 'start': 2402.705, 'duration': 2.123}, {'end': 2413.675, 'text': 'Now, going back to the types, I mentioned that Go actually implies the types of these three values automatically.', 'start': 2405.048, 'duration': 8.627}, {'end': 2422.238, 'text': 'And if you wanted, we could actually print out the types of variables using the printf function.', 'start': 2414.095, 'duration': 8.143}, {'end': 2436.863, 'text': "So with fmt printf, let's print out the types of these two variables and a constant.", 'start': 2422.578, 'duration': 14.285}, {'end': 2460.806, 'text': 'So conference tickets is whatever type it has then remaining tickets is whatever type this one has and then conference name is %t.', 'start': 2437.263, 'duration': 23.543}], 'summary': 'Go programming language detects errors before execution, implying types automatically.', 'duration': 134.598, 'max_score': 2326.208, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/yyUHQIec83I/pics/yyUHQIec83I2326208.jpg'}, {'end': 2395.398, 'src': 'embed', 'start': 2371.885, 'weight': 7, 'content': [{'end': 2382.209, 'text': 'defining a variable and not using it, or forgetting to specify a type, et cetera Go basically detects those errors before we even run the application.', 'start': 2371.885, 'duration': 10.324}, {'end': 2387.671, 'text': "So by the time we're ready to execute the application, we have fixed a bunch of errors.", 'start': 2382.509, 'duration': 5.162}, {'end': 2392.355, 'text': 'that Go identified and highlighted for us.', 'start': 2388.371, 'duration': 3.984}, {'end': 2395.398, 'text': "In many programming languages, that's not the case.", 'start': 2393.016, 'duration': 2.382}], 'summary': 'Go detects errors before execution, saving time and effort.', 'duration': 23.513, 'max_score': 2371.885, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/yyUHQIec83I/pics/yyUHQIec83I2371885.jpg'}, {'end': 2543.071, 'src': 'embed', 'start': 2510.088, 'weight': 8, 'content': [{'end': 2520.195, 'text': 'However, specifying a type explicitly when Go can detect it makes sense when we want to specify a different type than what Go would detect.', 'start': 2510.088, 'duration': 10.107}, {'end': 2526.599, 'text': 'For example, in Go specifically, again, we have multiple times for numeric values.', 'start': 2520.535, 'duration': 6.064}, {'end': 2539.75, 'text': 'So, in addition to int or integer type, which represents whole numbers, we have int 8, int 16, int 32, and int 64,,', 'start': 2527.04, 'duration': 12.71}, {'end': 2543.071, 'text': 'which corresponds to the length of the integer.', 'start': 2539.75, 'duration': 3.321}], 'summary': 'Specifying a different type than what go would detect can be done with int 8, int 16, int 32, and int 64.', 'duration': 32.983, 'max_score': 2510.088, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/yyUHQIec83I/pics/yyUHQIec83I2510088.jpg'}], 'start': 1269.863, 'title': 'Go conference booking application', 'summary': 'Introduces creating a welcome message, using variables and constants for conference name and ticket count, and tracking remaining tickets in a go conference booking application.', 'chapters': [{'end': 1840.067, 'start': 1269.863, 'title': 'Go conference booking application', 'summary': 'Introduces creating a welcome message, using variables and constants for conference name and ticket count, and tracking remaining tickets in a go conference booking application.', 'duration': 570.204, 'highlights': ['The chapter introduces creating a welcome message, using variables and constants for conference name and ticket count, and tracking remaining tickets in a Go conference booking application. The chapter focuses on creating a welcome message, utilizing variables and constants for the conference name and ticket count, and tracking remaining tickets in a Go conference booking application.', 'The value of the conference name is stored in a variable called name, allowing easy referencing throughout the application. The value of the conference name is stored in a variable called name, allowing for easy referencing throughout the application, promoting efficiency and maintainability.', 'The concept of variables in Go is explained, emphasizing the practice of creating variable names that properly describe the value. The concept of variables in Go is explained, emphasizing the practice of creating variable names that properly describe the value to enhance code clarity and understanding.', 'The usage of constants for values that do not change throughout the application such as the total conference tickets is demonstrated. The usage of constants for values that do not change throughout the application such as the total conference tickets is demonstrated, ensuring the constant value remains unchanged for the duration of the program.', 'Creating a variable to track the remaining tickets and using it to inform users about the available tickets in the welcome message. Creating a variable to track the remaining tickets and using it to inform users about the available tickets in the welcome message, ensuring users are informed about the availability of tickets.']}, {'end': 2125.905, 'start': 1843.755, 'title': 'Using printf for formatted output', 'summary': 'Explains the usage of the printf function from the format package in go, detailing its role in formatting variable values, replacing placeholders, and explicitly adding new lines, with a mention of different formatting options and the process of assigning values to variables.', 'duration': 282.15, 'highlights': ['The printf function from the format package in Go is specifically used for printing formatted data, making writing formatted outputs easier. ', 'The function uses placeholders annotated using %v, which are replaced with variable values, with the correct order needing to be maintained for multiple placeholders. ', 'The printf function allows for different formatting options for values, which can be found in the Go documentation under the fmt package link. ', 'The chapter also touches on the process of assigning values to variables in Go, particularly in scenarios where the value is not immediately known, such as when getting user input. ']}, {'end': 2354.218, 'start': 2126.045, 'title': 'Go data types', 'summary': 'Explains the concept of data types in go, covering strings and integers, the implication of data types when creating variables, and how to explicitly define a type to prevent assigning wrong data type values, with examples and syntax highlighting.', 'duration': 228.173, 'highlights': ['The most basic and common data types in Go are strings and integers, used for textual and numeric data respectively, with syntax highlighting for differentiating them.', 'When creating variables or constants and assigning a value immediately on the same line, Go can imply the data type based on the value, preventing syntax errors.', 'Explicitly defining a type is necessary when a value is not assigned immediately, to make the code more robust and prevent accidental assignment of wrong data type values later in the code.']}, {'end': 2655.795, 'start': 2354.718, 'title': 'Go programming: error detection and data types', 'summary': "Discusses go's ability to detect errors during coding, the automatic implication of variable types, and the significance of various integer and float data types, enabling automatic validation and precision, ultimately leading to error prevention and data accuracy.", 'duration': 301.077, 'highlights': ['Go detects errors in the code before executing the application, fixing a bunch of errors that were identified, providing a big advantage over other programming languages.', 'Go automatically implies the types of variables, allowing developers to print out the types using the printf function and enabling the explicit definition of types when necessary.', 'The availability of various integer data types in Go, such as int 8, int 16, int 32, and int 64, allows for automatic validation and protection of variables from receiving unintended values.', 'The use of float number types in scenarios requiring higher precision, such as statistical data or monetary values, is essential for accurate representation of fractional parts.', 'Specifying data types in Go helps prevent variables from receiving incorrect values, ensuring data accuracy and integrity during processing and calculations.']}], 'duration': 1385.932, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/yyUHQIec83I/pics/yyUHQIec83I1269863.jpg', 'highlights': ['The chapter introduces creating a welcome message, using variables and constants for conference name and ticket count, and tracking remaining tickets in a Go conference booking application.', 'The value of the conference name is stored in a variable called name, allowing easy referencing throughout the application.', 'The concept of variables in Go is explained, emphasizing the practice of creating variable names that properly describe the value.', 'The usage of constants for values that do not change throughout the application such as the total conference tickets is demonstrated.', 'Creating a variable to track the remaining tickets and using it to inform users about the available tickets in the welcome message.', 'The printf function from the format package in Go is specifically used for printing formatted data, making writing formatted outputs easier.', 'The most basic and common data types in Go are strings and integers, used for textual and numeric data respectively, with syntax highlighting for differentiating them.', 'Go detects errors in the code before executing the application, fixing a bunch of errors that were identified, providing a big advantage over other programming languages.', 'The availability of various integer data types in Go, such as int 8, int 16, int 32, and int 64, allows for automatic validation and protection of variables from receiving unintended values.', 'Specifying data types in Go helps prevent variables from receiving incorrect values, ensuring data accuracy and integrity during processing and calculations.']}, {'end': 3423.993, 'segs': [{'end': 2680.874, 'src': 'embed', 'start': 2656.556, 'weight': 2, 'content': [{'end': 2663.141, 'text': 'But as I said, there are other data types in Go besides textual and numeric types, which we will learn as well.', 'start': 2656.556, 'duration': 6.585}, {'end': 2667.584, 'text': 'Now there is one more thing in terms of variable definition in Go,', 'start': 2663.601, 'duration': 3.983}, {'end': 2676.992, 'text': 'and that is again specific to Go is that we have an alternative syntax for creating a variable and assigning it a value directly.', 'start': 2668.106, 'duration': 8.886}, {'end': 2680.874, 'text': 'This is like a syntactic sugar of Go language.', 'start': 2677.372, 'duration': 3.502}], 'summary': 'Go has alternative syntax for variable definition and assignment, beyond textual and numeric types.', 'duration': 24.318, 'max_score': 2656.556, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/yyUHQIec83I/pics/yyUHQIec83I2656556.jpg'}, {'end': 2773.695, 'src': 'embed', 'start': 2740.798, 'weight': 3, 'content': [{'end': 2745.16, 'text': 'And all these values will be then saved into variables like this.', 'start': 2740.798, 'duration': 4.362}, {'end': 2751.656, 'text': 'So we need some logic here that allows the application to ask for user input.', 'start': 2746.727, 'duration': 4.929}, {'end': 2759.67, 'text': 'In order to read user input, we use another function from the same format package called scan.', 'start': 2752.237, 'duration': 7.433}, {'end': 2773.695, 'text': 'So basically the format package gives us different functions to print out like this formatted output or read formatted input.', 'start': 2762.748, 'duration': 10.947}], 'summary': 'Using format package to save values into variables and read user input.', 'duration': 32.897, 'max_score': 2740.798, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/yyUHQIec83I/pics/yyUHQIec83I2740798.jpg'}, {'end': 2933.343, 'src': 'embed', 'start': 2903.077, 'weight': 0, 'content': [{'end': 2914.026, 'text': 'And a pointer is a variable that points to the memory address of another variable that references the actual value 50, for example.', 'start': 2903.077, 'duration': 10.949}, {'end': 2917.689, 'text': 'And pointers in Golang are also called special variables.', 'start': 2914.247, 'duration': 3.442}, {'end': 2921.853, 'text': "So to see that in the code, let's actually comment this out.", 'start': 2918.43, 'duration': 3.423}, {'end': 2930.078, 'text': 'And if we print out any variable like remaining tickets for example with value 50.', 'start': 2922.774, 'duration': 7.304}, {'end': 2933.343, 'text': 'This will give us the actual value 50.', 'start': 2930.078, 'duration': 3.265}], 'summary': 'Pointers in golang are special variables that reference the actual value 50.', 'duration': 30.266, 'max_score': 2903.077, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/yyUHQIec83I/pics/yyUHQIec83I2903077.jpg'}, {'end': 3401.456, 'src': 'embed', 'start': 3368.319, 'weight': 1, 'content': [{'end': 3370.361, 'text': 'Remaining tickets and conference tickets.', 'start': 3368.319, 'duration': 2.042}, {'end': 3388.85, 'text': "name. so with these changes, let's now run our go application and again enter the user values, and let's say we're buying 15 tickets and enter,", 'start': 3372.964, 'duration': 15.886}, {'end': 3393.251, 'text': 'and as you see, the remaining tickets are now 35, 50 minus 15 that we entered.', 'start': 3388.85, 'duration': 4.401}, {'end': 3401.456, 'text': 'Before moving on, I want to give a shout out to Kasten, who made this video possible.', 'start': 3396.633, 'duration': 4.823}], 'summary': '35 remaining tickets after 15 purchased. shout out to kasten.', 'duration': 33.137, 'max_score': 3368.319, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/yyUHQIec83I/pics/yyUHQIec83I3368319.jpg'}], 'start': 2656.556, 'title': 'Go variable definition, user input, and understanding pointers in golang', 'summary': "Covers alternative variable syntax in go, the inability to use it for constants, and the usage of the format package for input output processing, including scanning user input and saving it as a variable. it also explains the concept of pointers in golang, how they work, and their importance, demonstrating the use of pointers to store memory addresses and update variables, leading to the reduction of remaining tickets, and finally printing the updated number of remaining tickets, with a shout out to kasten's k10 data management platform for kubernetes.", 'chapters': [{'end': 2857.687, 'start': 2656.556, 'title': 'Go variable definition and user input', 'summary': 'Covers alternative variable syntax in go, the inability to use it for constants, and the usage of the format package for input output processing, including scanning user input and saving it as a variable.', 'duration': 201.131, 'highlights': ['The chapter covers alternative variable syntax in Go and the inability to use it for constants. Go introduces an alternative syntax for creating a variable and assigning it a value directly, which cannot be used for declaring constants.', 'The chapter explains the usage of the format package for input output processing, including scanning user input and saving it as a variable. The format package provides functions for input output processing, such as scanning user input and saving it as a variable, allowing the application to ask for user input.']}, {'end': 3423.993, 'start': 2858.228, 'title': 'Understanding pointers in golang', 'summary': "Explains the concept of pointers in golang, how they work, and their importance, demonstrating the use of pointers to store memory addresses and update variables, leading to the reduction of remaining tickets, and finally printing the updated number of remaining tickets, with a shout out to kasten's k10 data management platform for kubernetes.", 'duration': 565.765, 'highlights': ["The chapter explains the concept of pointers in Golang, how they work, and their importance, demonstrating the use of pointers to store memory addresses and update variables, leading to the reduction of remaining tickets, and finally printing the updated number of remaining tickets, with a shout out to Kasten's K10 data management platform for Kubernetes.", 'The remaining tickets are reduced by the number of tickets booked, updating the value of the remaining tickets variable, and printing the updated number of remaining tickets, e.g., 35 remaining tickets after purchasing 15 tickets.', 'Explanation of the importance of pointers in Golang, showcasing their use to store memory addresses and update variables, ensuring the efficient handling of memory and showcasing the concept not widely available in other programming languages like Java or JavaScript.']}], 'duration': 767.437, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/yyUHQIec83I/pics/yyUHQIec83I2656556.jpg', 'highlights': ["The chapter explains the concept of pointers in Golang, how they work, and their importance, demonstrating the use of pointers to store memory addresses and update variables, leading to the reduction of remaining tickets, and finally printing the updated number of remaining tickets, with a shout out to Kasten's K10 data management platform for Kubernetes.", 'The remaining tickets are reduced by the number of tickets booked, updating the value of the remaining tickets variable, and printing the updated number of remaining tickets, e.g., 35 remaining tickets after purchasing 15 tickets.', 'The chapter covers alternative variable syntax in Go and the inability to use it for constants. Go introduces an alternative syntax for creating a variable and assigning it a value directly, which cannot be used for declaring constants.', 'The chapter explains the usage of the format package for input output processing, including scanning user input and saving it as a variable. The format package provides functions for input output processing, such as scanning user input and saving it as a variable, allowing the application to ask for user input.']}, {'end': 4223.443, 'segs': [{'end': 3487.014, 'src': 'embed', 'start': 3450.389, 'weight': 0, 'content': [{'end': 3455.194, 'text': 'right to keep track of who is attending the event and who booked the tickets.', 'start': 3450.389, 'duration': 4.805}, {'end': 3460.461, 'text': 'And for that we have data types called arrays and slices.', 'start': 3455.775, 'duration': 4.686}, {'end': 3464.986, 'text': 'Arrays and slices are commonly used data types in Go applications.', 'start': 3461.001, 'duration': 3.985}, {'end': 3468.21, 'text': "So let's create an array for all the bookings.", 'start': 3465.527, 'duration': 2.683}, {'end': 3473.597, 'text': "So right here I'm going to create a variable called bookings and this is going to be an array.", 'start': 3468.791, 'duration': 4.806}, {'end': 3487.014, 'text': 'When we define an array, the first thing we need is the size, because arrays in Go have fixed size and for that we use square brackets,', 'start': 3474.198, 'duration': 12.816}], 'summary': 'Introduction to using arrays and slices in go for event bookings.', 'duration': 36.625, 'max_score': 3450.389, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/yyUHQIec83I/pics/yyUHQIec83I3450389.jpg'}, {'end': 4080.767, 'src': 'embed', 'start': 4053.028, 'weight': 1, 'content': [{'end': 4060.412, 'text': 'So how can we define a list that is more dynamic in size for such use cases?', 'start': 4053.028, 'duration': 7.384}, {'end': 4070.78, 'text': "So basically, at least where we don't have to specify a size at the beginning, but it automatically expands as new elements get added to it.", 'start': 4061.132, 'duration': 9.648}, {'end': 4076.944, 'text': "Well, exactly for that use case, instead of array, we have what's called a slice.", 'start': 4071.5, 'duration': 5.444}, {'end': 4080.767, 'text': 'Slice is basically an abstraction of an array.', 'start': 4077.745, 'duration': 3.022}], 'summary': 'Slices are a dynamic list that automatically expands as new elements are added.', 'duration': 27.739, 'max_score': 4053.028, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/yyUHQIec83I/pics/yyUHQIec83I4053028.jpg'}, {'end': 4135.781, 'src': 'embed', 'start': 4108.488, 'weight': 2, 'content': [{'end': 4115.471, 'text': 'Now, in an array, we added new elements using this index,', 'start': 4108.488, 'duration': 6.983}, {'end': 4127.596, 'text': 'which is not very convenient because for each new user we have to know exactly what is the next index that has a free spot or free place for the next value.', 'start': 4115.471, 'duration': 12.125}, {'end': 4131.339, 'text': "In slices, however, we don't need to use the index.", 'start': 4128.417, 'duration': 2.922}, {'end': 4135.781, 'text': 'Instead, we can just say, add the next element to the slice.', 'start': 4131.779, 'duration': 4.002}], 'summary': 'Using slices instead of arrays reduces the need for tracking index, making it more convenient for adding new elements.', 'duration': 27.293, 'max_score': 4108.488, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/yyUHQIec83I/pics/yyUHQIec83I4108488.jpg'}], 'start': 3424.393, 'title': 'Arrays and slices in go applications', 'summary': 'Covers the usage of arrays and slices in go applications, emphasizing the fixed size of arrays, specific data types they can contain, and their flexibility for adding or removing elements. it also explains the process of working with arrays and slices in go, highlighting the need for defining a dynamic size list using slices instead of arrays, and demonstrating the usage of indexes and built-in functions to add and retrieve elements, ultimately emphasizing the efficiency of working with slices over arrays.', 'chapters': [{'end': 3705.508, 'start': 3424.393, 'title': 'Arrays and slices in go applications', 'summary': 'Covers the usage of arrays and slices in go applications, emphasizing the fixed size of arrays, the specific data types they can contain, and their flexibility for adding or removing elements during application execution.', 'duration': 281.115, 'highlights': ['The chapter discusses the use of arrays and slices in Go applications, emphasizing the fixed size of arrays, which in this case is 50, and the specific data types they can contain, such as strings for storing names of users who book tickets.', 'It highlights the flexibility of arrays to add or remove elements during application execution, serving as a starting point with an empty array and gradually adding new values one by one as the program executes.', 'The chapter also explains the requirement to define the type of elements for the array in Go and the error that arises when declaring a variable without using it.']}, {'end': 4223.443, 'start': 3705.588, 'title': 'Working with arrays and slices', 'summary': 'Explains the process of working with arrays and slices in go, highlighting the need for defining a dynamic size list using slices instead of arrays, and demonstrating the usage of indexes and built-in functions to add and retrieve elements, ultimately emphasizing the efficiency of working with slices over arrays.', 'duration': 517.855, 'highlights': ['The need for defining a dynamic size list using slices instead of arrays Explains the need for dynamic size lists and introduces slices as an efficient solution for cases where the size of the list is not predetermined.', 'Demonstrating the usage of indexes and built-in functions to add and retrieve elements Illustrates the process of adding and retrieving elements in arrays and slices using indexes and built-in functions, emphasizing the different syntax for adding elements to a slice and retrieving values from it.', 'Emphasizing the efficiency of working with slices over arrays Highlights the efficiency of working with slices over arrays, emphasizing that slices provide a more efficient and dynamic option compared to arrays, especially in scenarios where the size of the list is not predetermined.']}], 'duration': 799.05, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/yyUHQIec83I/pics/yyUHQIec83I3424393.jpg', 'highlights': ['The chapter discusses the use of arrays and slices in Go applications, emphasizing the fixed size of arrays, which in this case is 50, and the specific data types they can contain, such as strings for storing names of users who book tickets.', 'The need for defining a dynamic size list using slices instead of arrays Explains the need for dynamic size lists and introduces slices as an efficient solution for cases where the size of the list is not predetermined.', 'Demonstrating the usage of indexes and built-in functions to add and retrieve elements Illustrates the process of adding and retrieving elements in arrays and slices using indexes and built-in functions, emphasizing the different syntax for adding elements to a slice and retrieving values from it.']}, {'end': 5291.705, 'segs': [{'end': 4347.006, 'src': 'embed', 'start': 4296.881, 'weight': 0, 'content': [{'end': 4304.007, 'text': 'where multiple people can book at the same time from their browsers, and the bookings will be persisted in a database.', 'start': 4296.881, 'duration': 7.126}, {'end': 4308.17, 'text': 'But in our case, we have a command line interface application.', 'start': 4304.648, 'duration': 3.522}, {'end': 4311.413, 'text': "So we're using our application only through the terminal.", 'start': 4308.671, 'duration': 2.742}, {'end': 4322.67, 'text': "So what we're going to do is create a constant loop where the application keeps asking for another ticket booking after one booking is done.", 'start': 4311.983, 'duration': 10.687}, {'end': 4326.632, 'text': 'to simulate booking a ticket multiple times for different users,', 'start': 4322.67, 'duration': 3.962}, {'end': 4335.978, 'text': 'and loops which is a concept that you may already know from other languages is basically use whenever we need to repeat the same logic multiple times.', 'start': 4326.632, 'duration': 9.346}, {'end': 4340.221, 'text': 'Now, in Go specifically, loops are actually simplified.', 'start': 4336.718, 'duration': 3.503}, {'end': 4347.006, 'text': "You don't have different types of loops like while loop and do while loop for each loop and so on.", 'start': 4340.581, 'duration': 6.425}], 'summary': 'Developing a command line interface application for continuous ticket booking in go.', 'duration': 50.125, 'max_score': 4296.881, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/yyUHQIec83I/pics/yyUHQIec83I4296881.jpg'}, {'end': 4944.22, 'src': 'embed', 'start': 4887.66, 'weight': 4, 'content': [{'end': 4897.371, 'text': 'remember, we use the append function, which has the slice variable inside and the element that we are adding, which is actually first name,', 'start': 4887.66, 'duration': 9.711}, {'end': 4902.475, 'text': 'and we have to then assign it back to the slice variable like this.', 'start': 4897.371, 'duration': 5.104}, {'end': 4906.656, 'text': "So again, we're defining a list variable here, a slice variable.", 'start': 4902.835, 'duration': 3.821}, {'end': 4913.319, 'text': "And then within this loop, one by one, we're adding a first name to this first name slice.", 'start': 4907.057, 'duration': 6.262}, {'end': 4921.982, 'text': "So at the end of the for loop, when we use first names here, it's going to have the list of all the first names from the bookings list.", 'start': 4913.779, 'duration': 8.203}, {'end': 4932.533, 'text': 'Now we can actually spare us this line here by just grabbing this value here and using it directly in the append.', 'start': 4922.927, 'duration': 9.606}, {'end': 4936.976, 'text': "So we don't need an additional variable like this.", 'start': 4933.233, 'duration': 3.743}, {'end': 4944.22, 'text': 'So basically, when the loop is done collecting the first names, we can print it out right here.', 'start': 4937.836, 'duration': 6.384}], 'summary': 'Using append function to collect and print first names from a list.', 'duration': 56.56, 'max_score': 4887.66, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/yyUHQIec83I/pics/yyUHQIec83I4887660.jpg'}, {'end': 5008.034, 'src': 'embed', 'start': 4982.372, 'weight': 6, 'content': [{'end': 4989.098, 'text': 'It needs to be there because we are expecting two values here, so we have to save both of them in a variable.', 'start': 4982.372, 'duration': 6.726}, {'end': 4997.966, 'text': 'So instead, we can fix the problem by simply using an underscore in its place, which is known as a blank identifier.', 'start': 4989.358, 'duration': 8.608}, {'end': 5003.25, 'text': 'In Go, underscores are used to identify unused variables.', 'start': 4998.366, 'duration': 4.884}, {'end': 5008.034, 'text': "So basically we're saying there is a variable here, but we just want to ignore it.", 'start': 5003.951, 'duration': 4.083}], 'summary': 'Go uses underscores as blank identifier to ignore unused variables.', 'duration': 25.662, 'max_score': 4982.372, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/yyUHQIec83I/pics/yyUHQIec83I4982372.jpg'}, {'end': 5106.465, 'src': 'embed', 'start': 5045.464, 'weight': 3, 'content': [{'end': 5048.267, 'text': 'And you see that our application logic works pretty good.', 'start': 5045.464, 'duration': 2.803}, {'end': 5051.731, 'text': 'We have updates in tickets after every booking.', 'start': 5048.708, 'duration': 3.023}, {'end': 5058.6, 'text': 'And at the end of each booking, we also get a list of first names printed out.', 'start': 5052.392, 'duration': 6.208}, {'end': 5062.664, 'text': 'And again, you can quit the application using control and C.', 'start': 5059, 'duration': 3.664}, {'end': 5069.585, 'text': 'Great Now we have two for loops in our application.', 'start': 5066.764, 'duration': 2.821}, {'end': 5072.886, 'text': 'But the first one, the indefinite for loop never ends.', 'start': 5070.045, 'duration': 2.841}, {'end': 5076.367, 'text': 'It keeps asking for the next booking.', 'start': 5073.426, 'duration': 2.941}, {'end': 5083.45, 'text': 'But what if all 50 tickets are booked out? We need to end the application and say that conference is sold out.', 'start': 5076.808, 'duration': 6.642}, {'end': 5088.372, 'text': 'So after every booking, we need to check if the remaining tickets is zero.', 'start': 5083.87, 'duration': 4.502}, {'end': 5091.714, 'text': 'And if it is, we end the application.', 'start': 5089.412, 'duration': 2.302}, {'end': 5093.735, 'text': 'Otherwise, we let it continue.', 'start': 5092.194, 'duration': 1.541}, {'end': 5102.262, 'text': 'And we do that using if else checks, which is a concept you have in all programming languages and is super easy.', 'start': 5094.156, 'duration': 8.106}, {'end': 5106.465, 'text': "So let's see how it works.", 'start': 5105.404, 'duration': 1.061}], 'summary': 'Application logic works well, updates tickets after each booking, ends when all 50 tickets are booked.', 'duration': 61.001, 'max_score': 5045.464, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/yyUHQIec83I/pics/yyUHQIec83I5045464.jpg'}, {'end': 5230.652, 'src': 'embed', 'start': 5201.706, 'weight': 9, 'content': [{'end': 5211.634, 'text': 'so this will basically end the loop, which means the application execution is over because there is nothing after the for loop right application ends.', 'start': 5201.706, 'duration': 9.928}, {'end': 5222.145, 'text': 'So, as I said, this expression here, or the value of this expression, is of a boolean data type.', 'start': 5212.677, 'duration': 9.468}, {'end': 5228.35, 'text': 'So we should have a boolean type keyword for that and be able to create variables of that type as well.', 'start': 5222.706, 'duration': 5.644}, {'end': 5230.652, 'text': 'Right Just like for other data types.', 'start': 5228.431, 'duration': 2.221}], 'summary': "The application execution ends after the for loop; the expression's value is boolean data type.", 'duration': 28.946, 'max_score': 5201.706, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/yyUHQIec83I/pics/yyUHQIec83I5201706.jpg'}], 'start': 4224.083, 'title': 'Managing user bookings and application logic in go', 'summary': 'Covers managing user bookings in a go command-line interface application, simplifying loops in go, fixing unused variables, and managing a ticket booking application. it includes details on saving user information, loop structures in go, handling unused variables, and managing application flow.', 'chapters': [{'end': 4322.67, 'start': 4224.083, 'title': 'Managing user bookings in application', 'summary': 'Discusses managing user bookings in a command line interface application, detailing the process of saving user information, cleaning up the code, and the need for a constant loop to enable multiple ticket bookings.', 'duration': 98.587, 'highlights': ['The application saves user information in the bookings list.', 'In the current setup, only one user can book a ticket at a time.', 'In real-life scenarios, a web application with UI and database support would enable multiple bookings.', 'The need for a constant loop for the application to accept multiple ticket bookings.']}, {'end': 4860.871, 'start': 4322.67, 'title': 'Go simplified loops', 'summary': 'Introduces the simplified loop structure in go, primarily focusing on the for loop, demonstrating its usage to repeat the booking logic multiple times and extract first names from the bookings list for privacy, allowing indefinite looping and specific list iteration, with a demonstration of the split function.', 'duration': 538.201, 'highlights': ['The for loop in Go is the primary loop structure, simplifying the concept by catering to different use cases and eliminating the need for multiple loop types, such as while or do-while loops.', 'Demonstrating the usage of the for loop for indefinite looping, allowing the repetitive booking logic to be executed for different users without the need for defining the loop termination condition.', 'Illustrating the utilization of the for loop for iterating through a specific list of elements, as shown by the extraction of first names from the bookings list to provide a level of privacy for the users.', 'Introducing the concept of range expression within the for loop to iterate over elements in data structures like arrays or slices, providing access to both the index and value for each element.', 'Explaining the usage of the strings package in Go for the split function, exemplified by splitting the full name string into first and last names to extract only the first name for privacy purposes.']}, {'end': 5031.654, 'start': 4861.371, 'title': 'Fixing unused variables and blank identifiers', 'summary': 'Discusses how to fix unused variables in a go program, including adding elements to a slice using the append function and using blank identifiers to ignore unused variables, resulting in an error-free application.', 'duration': 170.283, 'highlights': ['The chapter discusses adding elements to a slice using the append function, resulting in a list of first names from the bookings list.', 'Explanation of using an underscore as a blank identifier in Go to ignore unused variables, resolving the error and ensuring the application runs error-free.']}, {'end': 5291.705, 'start': 5045.464, 'title': 'Managing ticket booking application', 'summary': 'Explains how to manage a ticket booking application, including the logic for ending the program when all tickets are booked out, using if-else checks and creating a boolean variable to control application flow.', 'duration': 246.241, 'highlights': ['The application logic successfully updates tickets after each booking, and prints out a list of first names at the end of each booking. The application logic works well, updating tickets and displaying a list of first names at the end of each booking.', 'The chapter emphasizes the need to end the application when all 50 tickets are booked out, and explains the use of if-else checks to control the application flow. Emphasizes the importance of ending the application when all 50 tickets are booked out and explains the use of if-else checks to control the application flow.', 'The discussion covers the usage of boolean type keywords and creating variables of boolean type to control conditional statements. Discusses the usage of boolean type keywords and creating variables of boolean type to control conditional statements.']}], 'duration': 1067.622, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/yyUHQIec83I/pics/yyUHQIec83I4224083.jpg', 'highlights': ['The need for a constant loop for the application to accept multiple ticket bookings.', 'In real-life scenarios, a web application with UI and database support would enable multiple bookings.', 'The for loop in Go is the primary loop structure, simplifying the concept by catering to different use cases and eliminating the need for multiple loop types.', 'Demonstrating the usage of the for loop for indefinite looping, allowing the repetitive booking logic to be executed for different users without the need for defining the loop termination condition.', 'Illustrating the utilization of the for loop for iterating through a specific list of elements, as shown by the extraction of first names from the bookings list to provide a level of privacy for the users.', 'The chapter discusses adding elements to a slice using the append function, resulting in a list of first names from the bookings list.', 'Explanation of using an underscore as a blank identifier in Go to ignore unused variables, resolving the error and ensuring the application runs error-free.', 'The application logic successfully updates tickets after each booking, and prints out a list of first names at the end of each booking.', 'The chapter emphasizes the need to end the application when all 50 tickets are booked out, and explains the use of if-else checks to control the application flow.', 'The discussion covers the usage of boolean type keywords and creating variables of boolean type to control conditional statements.']}, {'end': 6257.315, 'segs': [{'end': 5375.719, 'src': 'embed', 'start': 5344.46, 'weight': 0, 'content': [{'end': 5348.041, 'text': 'Now, this makes sure that the program ends when all tickets are booked.', 'start': 5344.46, 'duration': 3.581}, {'end': 5358.704, 'text': "But what if a user wants to book more tickets than available? So what if I typed 52 instead of 50? Let's see what would happen in this case.", 'start': 5348.501, 'duration': 10.203}, {'end': 5360.962, 'text': 'with our application.', 'start': 5360.02, 'duration': 0.942}, {'end': 5362.727, 'text': "So let's run it again.", 'start': 5361.905, 'duration': 0.822}, {'end': 5367.398, 'text': "And I'm going to book 52 tickets.", 'start': 5366.075, 'duration': 1.323}, {'end': 5370.898, 'text': 'And this is the output.', 'start': 5369.778, 'duration': 1.12}, {'end': 5375.719, 'text': 'First of all, we have this weird number of tickets remaining.', 'start': 5371.178, 'duration': 4.541}], 'summary': 'Demonstrating how program handles overbooking by attempting to book 52 tickets instead of 50.', 'duration': 31.259, 'max_score': 5344.46, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/yyUHQIec83I/pics/yyUHQIec83I5344460.jpg'}, {'end': 5473.079, 'src': 'embed', 'start': 5431.532, 'weight': 1, 'content': [{'end': 5434.854, 'text': 'So if user is trying to book more tickets than is available.', 'start': 5431.532, 'duration': 3.322}, {'end': 5436.074, 'text': 'Again, very easy.', 'start': 5435.174, 'duration': 0.9}, {'end': 5451.128, 'text': 'We have if and then condition which says user tickets is more than remaining tickets, right? So this is going to be an invalid input from the user.', 'start': 5437.455, 'duration': 13.673}, {'end': 5461.993, 'text': 'So we need to tell the user something like we only have this many tickets remaining.', 'start': 5451.288, 'duration': 10.705}, {'end': 5473.079, 'text': "So you can't book so many tickets and that substitute those values.", 'start': 5462.834, 'duration': 10.245}], 'summary': 'System detects invalid ticket booking attempts and notifies user of remaining tickets.', 'duration': 41.547, 'max_score': 5431.532, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/yyUHQIec83I/pics/yyUHQIec83I5431532.jpg'}, {'end': 5593.921, 'src': 'embed', 'start': 5565.797, 'weight': 2, 'content': [{'end': 5571.421, 'text': "We want to tell the user, hey, you're trying to book an incorrect number of tickets.", 'start': 5565.797, 'duration': 5.624}, {'end': 5573.443, 'text': 'So please try again.', 'start': 5571.881, 'duration': 1.562}, {'end': 5581.188, 'text': 'So we want to skip all of these to the next iteration of the for loop instead of breaking out of the for loop completely.', 'start': 5573.503, 'duration': 7.685}, {'end': 5587.093, 'text': 'And we can do that also very easily using another instruction called continue.', 'start': 5581.689, 'duration': 5.404}, {'end': 5593.921, 'text': 'So instead of break, we say continue to the next iteration.', 'start': 5588.857, 'duration': 5.064}], 'summary': "Instruct user to book correct number of tickets, use 'continue' instead of 'break' in for loop.", 'duration': 28.124, 'max_score': 5565.797, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/yyUHQIec83I/pics/yyUHQIec83I5565797.jpg'}, {'end': 5679.857, 'src': 'embed', 'start': 5648.943, 'weight': 3, 'content': [{'end': 5654.206, 'text': 'So user tickets is either exactly the same as remaining tickets or is less.', 'start': 5648.943, 'duration': 5.263}, {'end': 5658.809, 'text': "And we say if this condition is true, so it's a valid input from the user.", 'start': 5654.687, 'duration': 4.122}, {'end': 5660.569, 'text': 'then everything is great.', 'start': 5659.449, 'duration': 1.12}, {'end': 5661.95, 'text': 'They can book the ticket.', 'start': 5660.97, 'duration': 0.98}, {'end': 5665.591, 'text': 'So this whole logic here can be executed.', 'start': 5662.05, 'duration': 3.541}, {'end': 5675.435, 'text': "So instead of these two lines, I'm going to put this outside of the if block.", 'start': 5666.212, 'duration': 9.223}, {'end': 5679.857, 'text': 'So instead, this logic will be executed.', 'start': 5676.196, 'duration': 3.661}], 'summary': 'User tickets must be same as or less than remaining tickets for valid input.', 'duration': 30.914, 'max_score': 5648.943, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/yyUHQIec83I/pics/yyUHQIec83I5648943.jpg'}, {'end': 5903.005, 'src': 'embed', 'start': 5872.005, 'weight': 5, 'content': [{'end': 5883.956, 'text': 'So, in addition to looping through a list like this, we can also say execute the code in a loop for as long as a specific condition is true,', 'start': 5872.005, 'duration': 11.951}, {'end': 5888.179, 'text': 'like execute code in this block within this for loop.', 'start': 5883.956, 'duration': 4.223}, {'end': 5902.664, 'text': 'for as long as remaining tickets is more than zero or as long as the size of the bookings list is less than 50, or even a combination of both,', 'start': 5889.181, 'duration': 13.483}, {'end': 5903.005, 'text': 'like this', 'start': 5902.664, 'duration': 0.341}], 'summary': 'Demonstrating looping through a list and executing code based on specific conditions.', 'duration': 31, 'max_score': 5872.005, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/yyUHQIec83I/pics/yyUHQIec83I5872005.jpg'}, {'end': 6009.941, 'src': 'embed', 'start': 5982.38, 'weight': 6, 'content': [{'end': 5992.73, 'text': "In our application, we're allowing users to enter their data, but users don't always enter data correctly, either intentionally or unintentionally.", 'start': 5982.38, 'duration': 10.35}, {'end': 6001.516, 'text': "And we developers must make sure that our application doesn't crash when user puts in bad input.", 'start': 5993.371, 'duration': 8.145}, {'end': 6009.941, 'text': 'So we have to make sure that our application is so robust that it can actually handle any type of bad user input.', 'start': 6001.916, 'duration': 8.025}], 'summary': 'Developers must ensure application can handle any type of bad user input.', 'duration': 27.561, 'max_score': 5982.38, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/yyUHQIec83I/pics/yyUHQIec83I5982380.jpg'}, {'end': 6067.512, 'src': 'embed', 'start': 6036.251, 'weight': 7, 'content': [{'end': 6037.471, 'text': 'The first name and last name.', 'start': 6036.251, 'duration': 1.22}, {'end': 6042.473, 'text': "And let's say the valid name for us is a string with at least two characters.", 'start': 6037.831, 'duration': 4.642}, {'end': 6047.396, 'text': 'Now, if the user provided a wrong name, this would not crash the application.', 'start': 6042.873, 'duration': 4.523}, {'end': 6053.581, 'text': 'But we want to make sure that users are not spamming our application and are actually giving correct information.', 'start': 6047.817, 'duration': 5.764}, {'end': 6055.823, 'text': 'At least we try to partially check that.', 'start': 6053.921, 'duration': 1.902}, {'end': 6063.269, 'text': 'And again, we have to do the validation part before the booking logic gets executed.', 'start': 6056.063, 'duration': 7.206}, {'end': 6067.512, 'text': "Right Because if they entered invalid data, we don't allow the booking.", 'start': 6063.329, 'duration': 4.183}], 'summary': 'Validate user input to prevent spam and ensure correct information before executing booking logic.', 'duration': 31.261, 'max_score': 6036.251, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/yyUHQIec83I/pics/yyUHQIec83I6036251.jpg'}, {'end': 6244.468, 'src': 'embed', 'start': 6195.948, 'weight': 8, 'content': [{'end': 6199.91, 'text': 'And that false value will then be assigned to is valid name variable.', 'start': 6195.948, 'duration': 3.962}, {'end': 6202.271, 'text': "Now let's validate the email address.", 'start': 6200.29, 'duration': 1.981}, {'end': 6209.233, 'text': "And let's say for email address, we want to make sure they're not entering an invalid email format.", 'start': 6203.031, 'duration': 6.202}, {'end': 6216.956, 'text': "So we're going to check that the value of email or the string contains the at sign.", 'start': 6209.713, 'duration': 7.243}, {'end': 6220.377, 'text': 'Now you already learned the strings package.', 'start': 6218.256, 'duration': 2.121}, {'end': 6244.468, 'text': 'from which we use this fields function and the same strings package actually has a function called contains that takes a string as a first input and then a character or multiple characters that we want to search in that string.', 'start': 6221.616, 'duration': 22.852}], 'summary': 'Validating email format using contains function from strings package.', 'duration': 48.52, 'max_score': 6195.948, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/yyUHQIec83I/pics/yyUHQIec83I6195948.jpg'}], 'start': 5292.045, 'title': 'User ticket bookings and logic', 'summary': 'Covers handling user ticket bookings, improving application functionality by fixing logic, introducing user-friendly ticket booking logic, using conditionals in programming, and discussing user input validation for robustness.', 'chapters': [{'end': 5623.282, 'start': 5292.045, 'title': 'Handling user ticket bookings', 'summary': 'Discusses testing and fixing logic to end the program when all 50 tickets are booked, handling user attempts to book more than available tickets, and allowing users to try again with the corrected number of tickets, resulting in improved application functionality.', 'duration': 331.237, 'highlights': ['The program ends when all 50 tickets are booked, preventing further bookings and exiting the application.', 'An invalid user input of attempting to book more tickets than available triggers a message informing the user and prevents the booking, leading to improved user experience and application functionality.', "The 'continue' instruction allows the program to skip the current iteration and proceed to the next, enabling users to attempt booking with the corrected number of tickets without ending the loop."]}, {'end': 5840.33, 'start': 5623.583, 'title': 'User-friendly ticket booking logic', 'summary': 'Introduces a more user-friendly ticket booking logic, allowing for checking if the user wants to book less tickets or exactly the same number, and handles the conditions using if-else statements to execute the appropriate logic.', 'duration': 216.747, 'highlights': ['The chapter introduces a more user-friendly ticket booking logic. The chapter focuses on enhancing the user experience by implementing a more user-friendly ticket booking logic.', 'Handling conditions using if-else statements to execute the appropriate logic. The chapter demonstrates the use of if-else statements to handle different conditions for ticket booking, ensuring the execution of the appropriate logic based on the user input.', 'Introducing if-else statement to check if the user wants to book less tickets or exactly the same number. The chapter introduces the use of if-else statements to check whether the user wants to book less tickets or exactly the same number, improving the flexibility of the ticket booking process.']}, {'end': 5981.84, 'start': 5840.631, 'title': 'Using conditionals in programming', 'summary': 'Explains the use of conditionals in programming through if-else statements and for loops, including examples of true or false conditions, as well as a demonstration of an infinite for loop using a true condition.', 'duration': 141.209, 'highlights': ['For loops can execute code based on specific conditions, such as remaining tickets being more than zero or the size of the bookings list being less than 50. The chapter demonstrates the usage of conditions in for loops, where code can be executed based on specific conditions, for example, remaining tickets being more than zero or the size of the bookings list being less than 50.', "An infinite loop can be created by using a condition of true, allowing the loop to execute indefinitely. The explanation includes creating an infinite loop by using the condition 'true,' resulting in the loop executing indefinitely.", 'If-else statements can be used for user input validation, providing a common use case for these conditional statements. The transcript mentions the common use case of user input validation using if-else statements, showcasing the practical application of conditionals in programming.']}, {'end': 6257.315, 'start': 5982.38, 'title': 'User input validation', 'summary': 'Discusses the importance of validating user input to ensure robustness, including checking for valid names and email formats, and using boolean expressions to determine input validity.', 'duration': 274.935, 'highlights': ['The importance of validating user input is highlighted, as users may not always enter data correctly, emphasizing the need to ensure application robustness.', 'The chapter emphasizes the validation of user input for names, requiring at least two characters for both the first and last names to be considered valid.', "The process of validating an email address is explained, involving checking for the presence of the '@' symbol to ensure a valid email format."]}], 'duration': 965.27, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/yyUHQIec83I/pics/yyUHQIec83I5292045.jpg', 'highlights': ['The program ends when all 50 tickets are booked, preventing further bookings and exiting the application.', 'An invalid user input of attempting to book more tickets than available triggers a message informing the user and prevents the booking, leading to improved user experience and application functionality.', "The 'continue' instruction allows the program to skip the current iteration and proceed to the next, enabling users to attempt booking with the corrected number of tickets without ending the loop.", 'The chapter introduces a more user-friendly ticket booking logic. The chapter focuses on enhancing the user experience by implementing a more user-friendly ticket booking logic.', 'Handling conditions using if-else statements to execute the appropriate logic. The chapter demonstrates the use of if-else statements to handle different conditions for ticket booking, ensuring the execution of the appropriate logic based on the user input.', 'For loops can execute code based on specific conditions, such as remaining tickets being more than zero or the size of the bookings list being less than 50. The chapter demonstrates the usage of conditions in for loops, where code can be executed based on specific conditions, for example, remaining tickets being more than zero or the size of the bookings list being less than 50.', 'The importance of validating user input is highlighted, as users may not always enter data correctly, emphasizing the need to ensure application robustness.', 'The chapter emphasizes the validation of user input for names, requiring at least two characters for both the first and last names to be considered valid.', "The process of validating an email address is explained, involving checking for the presence of the '@' symbol to ensure a valid email format."]}, {'end': 7922.143, 'segs': [{'end': 6320.574, 'src': 'embed', 'start': 6292.108, 'weight': 1, 'content': [{'end': 6295.131, 'text': 'So it has to be positive number greater than zero.', 'start': 6292.108, 'duration': 3.023}, {'end': 6301.156, 'text': 'So again, user tickets is more than zero will be a valid ticket count.', 'start': 6295.871, 'duration': 5.285}, {'end': 6308.562, 'text': "Now we have another check for the user tickets, which is that it's less than remaining tickets.", 'start': 6301.776, 'duration': 6.786}, {'end': 6311.084, 'text': 'So a user cannot book more tickets than available.', 'start': 6308.582, 'duration': 2.502}, {'end': 6314.246, 'text': "So that's going to be another validation for this input.", 'start': 6311.564, 'duration': 2.682}, {'end': 6318.13, 'text': 'And we can actually add that right here.', 'start': 6314.847, 'duration': 3.283}, {'end': 6320.574, 'text': 'also with this end sign.', 'start': 6319.153, 'duration': 1.421}], 'summary': 'Valid ticket count must be a positive number and less than remaining tickets.', 'duration': 28.466, 'max_score': 6292.108, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/yyUHQIec83I/pics/yyUHQIec83I6292108.jpg'}, {'end': 6439.543, 'src': 'embed', 'start': 6410.804, 'weight': 2, 'content': [{'end': 6413.785, 'text': 'If it has some other value, then it is an invalid city.', 'start': 6410.804, 'duration': 2.981}, {'end': 6417.566, 'text': "But if it's valid, then it should be either or.", 'start': 6414.285, 'duration': 3.281}, {'end': 6422.307, 'text': 'So in this case, we change this condition using or instead of int.', 'start': 6418.006, 'duration': 4.301}, {'end': 6427.868, 'text': 'Well, sometimes we need to check whether the user did not enter a specific value.', 'start': 6423.007, 'duration': 4.861}, {'end': 6432.009, 'text': "For example, let's say we want to check is invalid city.", 'start': 6428.268, 'duration': 3.741}, {'end': 6439.543, 'text': "which means user didn't enter either Singapore.", 'start': 6435.282, 'duration': 4.261}], 'summary': 'Valid city should be either singapore or int', 'duration': 28.739, 'max_score': 6410.804, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/yyUHQIec83I/pics/yyUHQIec83I6410804.jpg'}, {'end': 6557.934, 'src': 'embed', 'start': 6531.209, 'weight': 0, 'content': [{'end': 6536.71, 'text': 'So if name and email are correct, but the ticket number is invalid, of course, we want to skip the booking.', 'start': 6531.209, 'duration': 5.501}, {'end': 6553.234, 'text': 'So in the if statement, we check if is valid name is true and is valid email is also true and is valid ticket number is also true.', 'start': 6537.37, 'duration': 15.864}, {'end': 6557.934, 'text': 'So all three have to be true in order to execute the booking.', 'start': 6553.594, 'duration': 4.34}], 'summary': 'To execute the booking, the name, email, and ticket number all need to be valid.', 'duration': 26.725, 'max_score': 6531.209, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/yyUHQIec83I/pics/yyUHQIec83I6531209.jpg'}, {'end': 6853.958, 'src': 'embed', 'start': 6829.585, 'weight': 3, 'content': [{'end': 6837.547, 'text': 'So as you see, if-else statements are super important in applications because they basically control the whole application flow.', 'start': 6829.585, 'duration': 7.962}, {'end': 6842.688, 'text': "It's like a decision tree, right? We do different things based on different conditions.", 'start': 6837.907, 'duration': 4.781}, {'end': 6849.99, 'text': "Now let's see another concept in programming, which is similar to if-else statements, which is switch statement.", 'start': 6843.528, 'duration': 6.462}, {'end': 6853.958, 'text': "Let's say our conference is held in six different cities.", 'start': 6850.936, 'duration': 3.022}], 'summary': 'If-else and switch statements are crucial in programming, controlling application flow and executing different actions based on conditions.', 'duration': 24.373, 'max_score': 6829.585, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/yyUHQIec83I/pics/yyUHQIec83I6829585.jpg'}, {'end': 7189.266, 'src': 'embed', 'start': 7158.41, 'weight': 4, 'content': [{'end': 7160.492, 'text': "So let's see how to write functions in Go.", 'start': 7158.41, 'duration': 2.082}, {'end': 7166.557, 'text': 'Well, in fact, we have already created a function at the beginning, which was the main function.', 'start': 7160.912, 'duration': 5.645}, {'end': 7173.462, 'text': "So the same way after the main function ends right here, That's the end of the main function block.", 'start': 7166.857, 'duration': 6.605}, {'end': 7177.543, 'text': 'We create another one using a funk keyword.', 'start': 7174.202, 'duration': 3.341}, {'end': 7179.683, 'text': 'Then again, name of the function.', 'start': 7178.123, 'duration': 1.56}, {'end': 7183.404, 'text': "And let's call this one greet users.", 'start': 7180.103, 'duration': 3.301}, {'end': 7189.266, 'text': 'And after that, we have again function block using the curly braces.', 'start': 7184.985, 'duration': 4.281}], 'summary': 'The transcript discusses writing functions in go, including the main function and creating another function using the funk keyword.', 'duration': 30.856, 'max_score': 7158.41, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/yyUHQIec83I/pics/yyUHQIec83I7158410.jpg'}], 'start': 6257.735, 'title': 'User input validation and code organization', 'summary': 'Covers user input validations for email, ticket count, and city selection, including the utilization of logical conditions, implementation of user input validation in a program, importance of switch statements, and organizing code with functions in go.', 'chapters': [{'end': 6499.805, 'start': 6257.735, 'title': 'User input validations', 'summary': 'Explains the process of validating user input for email, ticket count, and city selection, employing logical conditions to ensure validity and prevent errors.', 'duration': 242.07, 'highlights': ['The chapter explains the process of validating user input for email, ticket count, and city selection, employing logical conditions to ensure validity and prevent errors. It covers the validation of user input for email, ticket count, and city selection, using logical conditions to ensure validity and prevent errors.', 'User tickets validation includes ensuring the count is a positive number greater than zero and less than the remaining tickets. Validating user tickets involves ensuring the count is a positive number greater than zero and less than the remaining tickets.', 'The chapter presents the usage of OR logical conditions for city selection validation, allowing only specific valid city inputs. It discusses the usage of OR logical conditions for city selection validation, allowing only specific valid city inputs.', 'The explanation of negation or not equal usage in the context of city validation is detailed, providing an alternative approach to achieve the same result. It details the usage of negation or not equal in the context of city validation, providing an alternative approach to achieve the same result.']}, {'end': 6828.944, 'start': 6500.606, 'title': 'User input validation', 'summary': 'Discusses the implementation of user input validation in a program, using variables to store input checks and if statements to execute booking only if all user input values are valid, informing users about the specific incorrect input data, and testing the validation logic.', 'duration': 328.338, 'highlights': ['The implementation of user input validation in a program, using variables to store input checks and if statements to execute booking only if all user input values are valid. implementation of user input validation, using if statements', "Informing users about the specific incorrect input data, such as the length of the name, presence of '@' in the email address, and validity of the ticket number. informing users about specific incorrect input data", 'Testing the validation logic by inputting wrong data, resulting in specific error messages informing the user about the incorrect inputs. testing the validation logic with wrong data']}, {'end': 7130.574, 'start': 6829.585, 'title': 'Switch statements in applications', 'summary': 'Explains the importance of switch statements in controlling application flow, with an example of handling different city selections and consolidating logic for multiple values.', 'duration': 300.989, 'highlights': ['Switch statements control application flow based on variable values, avoiding the need for multiple if-else statements. It consolidates logic for multiple values, reducing code duplication. Switch statements are important in controlling application flow and can consolidate logic for multiple values, avoiding code duplication.', 'The example demonstrates handling different city selections and executing specific logic based on user input, showcasing the practical application of switch statements. The example illustrates handling different city selections and executing specific logic based on user input, demonstrating the practical use of switch statements.', 'Switch statements are compared to if-else statements, emphasizing their efficiency in managing application flow and executing different logic based on variable values. Switch statements are compared to if-else statements, emphasizing their efficiency in managing application flow and executing different logic based on variable values.']}, {'end': 7507.14, 'start': 7131.074, 'title': 'Organizing code with functions in go', 'summary': 'Explains the process of writing and utilizing functions in go, highlighting the creation and execution of functions, passing input parameters, and organizing code for a cleaner main function.', 'duration': 376.066, 'highlights': ['Functions in Go encapsulate code blocks, allowing for clearer organization and reusability. The chapter emphasizes the usage of functions in Go to encapsulate code blocks, promoting clearer organization and reusability.', "Creation and execution of functions in Go, demonstrated through the creation of the 'greet users' function, which prints a welcome message. The chapter illustrates the creation and execution of functions in Go, showcasing the 'greet users' function as an example, which prints a welcome message.", "Passing input parameters to a function in Go, with an example of passing the 'conference name' variable as an input parameter to the 'greet users' function. The chapter explains the process of passing input parameters to functions in Go, demonstrated through passing the 'conference name' variable as an input parameter to the 'greet users' function."]}, {'end': 7922.143, 'start': 7507.821, 'title': 'Refactoring code into functions', 'summary': "Demonstrates refactoring code into functions, including defining input parameters, returning values, and handling errors, with the example showing the extraction of logic into separate functions and the use of go's ability to return multiple values from a function.", 'duration': 414.322, 'highlights': ['The chapter demonstrates the extraction of code into functions, showing the process of defining input parameters, returning values, and handling errors.', 'The example includes the extraction of logic into separate functions, such as greeting users and printing first names from a slice, with descriptive function names for clarity.', "The transcript also highlights the use of Go's ability to return multiple values from a function, allowing for the return of three values from a single function, which is not possible in most programming languages."]}], 'duration': 1664.408, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/yyUHQIec83I/pics/yyUHQIec83I6257735.jpg', 'highlights': ['The chapter explains the process of validating user input for email, ticket count, and city selection, employing logical conditions to ensure validity and prevent errors.', 'User tickets validation includes ensuring the count is a positive number greater than zero and less than the remaining tickets.', 'The chapter presents the usage of OR logical conditions for city selection validation, allowing only specific valid city inputs.', 'Switch statements control application flow based on variable values, avoiding the need for multiple if-else statements.', 'Functions in Go encapsulate code blocks, allowing for clearer organization and reusability.']}, {'end': 8844.835, 'segs': [{'end': 7951.08, 'src': 'embed', 'start': 7922.963, 'weight': 0, 'content': [{'end': 7932.546, 'text': 'And, of course, the same way as with one return value, we have to define the types, the data types of all the return values in order,', 'start': 7922.963, 'duration': 9.583}, {'end': 7935.591, 'text': 'which We do outside those parentheses.', 'start': 7932.546, 'duration': 3.045}, {'end': 7942.575, 'text': 'And when we have multiple returns, we have to also enclose them in its own separate parentheses.', 'start': 7936.332, 'duration': 6.243}, {'end': 7951.08, 'text': "So within this block, we're going to define the data types of these three values, which are all Boolean, true or false values.", 'start': 7943.015, 'duration': 8.065}], 'summary': 'Defining data types for multiple return values, all boolean, within separate parentheses.', 'duration': 28.117, 'max_score': 7922.963, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/yyUHQIec83I/pics/yyUHQIec83I7922963.jpg'}, {'end': 8495.671, 'src': 'embed', 'start': 8463.356, 'weight': 1, 'content': [{'end': 8469.418, 'text': 'We have descriptive function names that basically tells us what exactly is happening within the main function.', 'start': 8463.356, 'duration': 6.062}, {'end': 8472.919, 'text': "We're greeting the users, then we're getting their inputs.", 'start': 8470.038, 'duration': 2.881}, {'end': 8474.559, 'text': "We're validating that input.", 'start': 8473.039, 'duration': 1.52}, {'end': 8480.741, 'text': "And if everything is valid, we're booking the ticket, then getting the first names and printing them.", 'start': 8475.399, 'duration': 5.342}, {'end': 8486.324, 'text': 'And if the remaining tickets is zero, we just end the program.', 'start': 8482.441, 'duration': 3.883}, {'end': 8495.671, 'text': 'And all this logic that was basically crowding the main function is now encapsulated in its own small functions.', 'start': 8487.265, 'duration': 8.406}], 'summary': 'Descriptive function names encapsulate logic for greeting users, getting inputs, validating, and booking tickets, improving main function clarity.', 'duration': 32.315, 'max_score': 8463.356, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/yyUHQIec83I/pics/yyUHQIec83I8463356.jpg'}], 'start': 7922.963, 'title': 'Go code organization', 'summary': 'Covers defining multiple return values, refactoring code to reduce repetition, and organizing go code into packages and files, emphasizing efficient development and maintenance.', 'chapters': [{'end': 7976.139, 'start': 7922.963, 'title': 'Defining multiple return values in go', 'summary': 'Explains the process of defining multiple return values in go, emphasizing the need to define the data types of the return values and encapsulate them in separate parentheses, with a specific example illustrating the use of boolean values.', 'duration': 53.176, 'highlights': ['The process involves defining the data types of the return values and encapsulating them in separate parentheses outside the input parameters, as demonstrated with the example of Boolean values.', 'It is essential to define the types of all return values in order, and when multiple returns are involved, they must be enclosed in their separate parentheses.', 'The example illustrates the definition of three Boolean return values, emphasizing the clear distinction between input and output parameters.', 'The chapter emphasizes the straightforward process of collecting the multiple return values outside the defined block.']}, {'end': 8462.376, 'start': 7976.439, 'title': 'Refactoring code and reducing repetition', 'summary': 'Demonstrates the process of refactoring code to create separate functions for user input, booking, and validation, and the use of package level variables to reduce the repetition of passing the same parameters to different functions.', 'duration': 485.937, 'highlights': ["The chapter focuses on refactoring code to create separate functions for user input, booking, and validation, improving the main function's readability and descriptiveness.", "The process involves extracting code for getting user input and booking the application into separate functions, thereby reducing the main function's size and increasing its descriptiveness.", 'The use of package level variables is highlighted as a method to reduce the repetition of passing the same parameters to different functions, improving the cleanliness and readability of the code.']}, {'end': 8844.835, 'start': 8463.356, 'title': 'Organizing go code into packages and files', 'summary': 'Discusses the benefits of encapsulating code into small functions, reusing code across an application, and organizing code into multiple files and packages in go, ensuring efficient development and maintenance.', 'duration': 381.479, 'highlights': ['Encapsulating code into small functions The code logic is encapsulated into small functions, such as greeting the users, validating input, booking tickets, and printing first names, improving code readability and maintainability.', 'Reusing code across applications Functions allow the same block of code to be reused in different parts of the application, enhancing code reusability and reducing redundancy in logic implementation.', 'Organizing code into multiple files and packages The code can be organized into multiple files within the same package, enabling efficient management of larger codebases and facilitating code sharing across different files.']}], 'duration': 921.872, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/yyUHQIec83I/pics/yyUHQIec83I7922963.jpg', 'highlights': ['The process involves defining the data types of the return values and encapsulating them in separate parentheses outside the input parameters, as demonstrated with the example of Boolean values.', "The chapter focuses on refactoring code to create separate functions for user input, booking, and validation, improving the main function's readability and descriptiveness.", 'Encapsulating code into small functions The code logic is encapsulated into small functions, such as greeting the users, validating input, booking tickets, and printing first names, improving code readability and maintainability.']}, {'end': 9995.889, 'segs': [{'end': 8933.685, 'src': 'embed', 'start': 8892.395, 'weight': 2, 'content': [{'end': 8899.881, 'text': 'In that case, we could actually create own packages for each of the conference and put the booking logic there.', 'start': 8892.395, 'duration': 7.486}, {'end': 8906.367, 'text': "And plus, let's say they share some common logic like validating user input.", 'start': 8900.181, 'duration': 6.186}, {'end': 8912.371, 'text': 'And that could also be a separate package that all other packages may share.', 'start': 8906.807, 'duration': 5.564}, {'end': 8920.456, 'text': 'So basically, these multiple packages helps you organize your code and group the logic in a way that makes sense for your application.', 'start': 8912.651, 'duration': 7.805}, {'end': 8923.318, 'text': 'So this is a way to logically group your code.', 'start': 8920.536, 'duration': 2.782}, {'end': 8931.023, 'text': "So let's say in our example, we wanted to put this helper functionality in its own package.", 'start': 8923.718, 'duration': 7.305}, {'end': 8933.685, 'text': "And let's call this package also helper.", 'start': 8931.323, 'duration': 2.362}], 'summary': 'Creating separate packages can help organize and group code logically for applications.', 'duration': 41.29, 'max_score': 8892.395, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/yyUHQIec83I/pics/yyUHQIec83I8892395.jpg'}, {'end': 9352.187, 'src': 'heatmap', 'start': 9223.549, 'weight': 0.777, 'content': [{'end': 9226.751, 'text': 'We have printf with capital P, println.', 'start': 9223.549, 'duration': 3.202}, {'end': 9230.433, 'text': 'Here we have strings.fields with capital F.', 'start': 9227.271, 'duration': 3.162}, {'end': 9233.515, 'text': 'So that is the same concept right here.', 'start': 9230.433, 'duration': 3.082}, {'end': 9241.68, 'text': "These are functions that have been exported in these packages, and that's why we're able to use them.", 'start': 9233.795, 'duration': 7.885}, {'end': 9254.98, 'text': 'And by the way, you can not only export functions from other packages, but you can also export variables also by capitalizing the variable name.', 'start': 9243.891, 'duration': 11.089}, {'end': 9260.845, 'text': 'So, for example, if all the conferences had the same number of tickets available,', 'start': 9255.22, 'duration': 5.625}, {'end': 9269.733, 'text': 'you could define that in this helper package as a variable and then exported simply by using a capitalized variable name.', 'start': 9260.845, 'duration': 8.888}, {'end': 9279.441, 'text': 'and finally, we have an error here because remaining tickets variable is not available anymore for this function,', 'start': 9270.493, 'duration': 8.948}, {'end': 9283.424, 'text': "and that's again because we moved this function from a main package,", 'start': 9279.441, 'duration': 3.983}, {'end': 9293.213, 'text': 'and main package right here defines a package level variable called remaining tickets, which is only available within the package main.', 'start': 9283.424, 'duration': 9.789}, {'end': 9297.757, 'text': "that's why it's called package level, so it's not visible to other packages.", 'start': 9293.213, 'duration': 4.544}, {'end': 9303.98, 'text': 'Again, as I said, we could export this variable using uppercase in the name.', 'start': 9298.357, 'duration': 5.623}, {'end': 9308.141, 'text': 'But in our case, we will just pass the variable as an input parameter.', 'start': 9304.32, 'duration': 3.821}, {'end': 9309.222, 'text': "So let's do that.", 'start': 9308.582, 'duration': 0.64}, {'end': 9310.963, 'text': 'Validate user input.', 'start': 9309.722, 'duration': 1.241}, {'end': 9320.467, 'text': 'And of course, we have to also edit in the function specification and remaining tickets is of you in type.', 'start': 9312.984, 'duration': 7.483}, {'end': 9327.57, 'text': 'And that fixes last issue and our application should work again.', 'start': 9322.128, 'duration': 5.442}, {'end': 9335.541, 'text': 'So if I execute the application, everything works fine again.', 'start': 9330.7, 'duration': 4.841}, {'end': 9343.104, 'text': 'And one more thing that I want to note here is all the places we have created variables.', 'start': 9337.562, 'duration': 5.542}, {'end': 9352.187, 'text': 'First of all, we have created variables within individual functions, which made these variables available only within those functions.', 'start': 9344.084, 'duration': 8.103}], 'summary': 'Functions and variables are exported by capitalizing their names, and package-level variables are not visible to other packages.', 'duration': 128.638, 'max_score': 9223.549, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/yyUHQIec83I/pics/yyUHQIec83I9223549.jpg'}, {'end': 9526.752, 'src': 'embed', 'start': 9486.095, 'weight': 1, 'content': [{'end': 9495.079, 'text': 'Now bookings in our case is a slice, which allows us to save a list of string values, which are the full names.', 'start': 9486.095, 'duration': 8.984}, {'end': 9507.105, 'text': 'But instead of just a simple string like this, we want a data type with multiple key value pairs per user.', 'start': 9495.8, 'duration': 11.305}, {'end': 9526.752, 'text': 'So something like first name, and its value last name and its value email and number of tickets.', 'start': 9508.026, 'duration': 18.726}], 'summary': "Using slices to save full names and multiple key-value pairs for users' data.", 'duration': 40.657, 'max_score': 9486.095, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/yyUHQIec83I/pics/yyUHQIec83I9486095.jpg'}, {'end': 9594.265, 'src': 'embed', 'start': 9561.51, 'weight': 0, 'content': [{'end': 9572.232, 'text': 'So for each user, we will have a MEP with key names like this and their respective values, which of course will be different for each user.', 'start': 9561.51, 'duration': 10.722}, {'end': 9584.678, 'text': "So let's see how we can turn our bookings list from a list of strings to a list of maps.", 'start': 9573.094, 'duration': 11.584}, {'end': 9594.265, 'text': "First of all, let's go to the book ticket function where we're adding users first name and last name to the bookings list.", 'start': 9585.479, 'duration': 8.786}], 'summary': 'Mep will have key names and values for each user; bookings list to be transformed from strings to maps.', 'duration': 32.755, 'max_score': 9561.51, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/yyUHQIec83I/pics/yyUHQIec83I9561510.jpg'}], 'start': 8845.436, 'title': 'Organizing code and optimizing storage', 'summary': 'Covers organizing code into multiple packages to enhance manageability and discusses optimizing user information storage by transitioning the bookings list to a map data type to store user details, including first name, last name, email, and ticket count.', 'chapters': [{'end': 9435.832, 'start': 8845.436, 'title': 'Organizing code with multiple packages', 'summary': 'Explains the benefits of organizing code into multiple packages to logically group the application code and make it more manageable, allowing for the creation of own packages for different functionalities, the need to import packages using the module name, how to export functions and variables and the concept of variable scope.', 'duration': 590.396, 'highlights': ['Organizing code into multiple packages helps logically group the application code and make it more manageable. The chapter highlights the benefits of organizing code into multiple packages to logically group the application code and make it more manageable.', "Creation of own packages for different functionalities in the application, such as creating separate packages for different conferences' booking logic and sharing common logic across multiple packages. The chapter explains the use case of creating own packages for different functionalities in the application, such as creating separate packages for different conferences' booking logic and sharing common logic across multiple packages.", 'The need to import packages using the module name to use functions defined inside those packages. The chapter explains the need to import packages using the module name to use functions defined inside those packages.', 'Explanation of exporting functions and variables, and the concept of variable scope in Go, including the requirement to capitalize the function or variable name to export them. The chapter details the explanation of exporting functions and variables, and the concept of variable scope in Go, including the requirement to capitalize the function or variable name to export them.']}, {'end': 9995.889, 'start': 9439.676, 'title': 'Optimizing user information storage', 'summary': "Discusses the need to optimize user information storage in the application, transitioning the bookings list from a list of strings to a list of maps to store users' first name, last name, email, and number of tickets, using the map data type and converting uint to string for ticket data.", 'duration': 556.213, 'highlights': ["The need to optimize user information storage in the application by transitioning the bookings list from a list of strings to a list of maps to store users' first name, last name, email, and number of tickets.", 'Utilizing the map data type to store multiple key-value pairs per user, allowing for the storage of user information such as first name, last name, email, and number of tickets for each user.', "Demonstrating the process of creating an empty map using the built-in function 'make' and adding user data key-value pairs to the map using the square brackets syntax.", "Explaining the conversion of uint to string for the user tickets value using the built-in function 'formatUint' from the 'strconv' package, facilitating the storage of ticket data as strings in the user data map."]}], 'duration': 1150.453, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/yyUHQIec83I/pics/yyUHQIec83I8845436.jpg', 'highlights': ["The need to optimize user information storage in the application by transitioning the bookings list from a list of strings to a list of maps to store users' first name, last name, email, and number of tickets.", 'Utilizing the map data type to store multiple key-value pairs per user, allowing for the storage of user information such as first name, last name, email, and number of tickets for each user.', "Creation of own packages for different functionalities in the application, such as creating separate packages for different conferences' booking logic and sharing common logic across multiple packages.", 'Organizing code into multiple packages helps logically group the application code and make it more manageable.']}, {'end': 10860.016, 'segs': [{'end': 10087.968, 'src': 'embed', 'start': 10025.732, 'weight': 1, 'content': [{'end': 10029.515, 'text': "I'm going to call it number of tickets.", 'start': 10025.732, 'duration': 3.783}, {'end': 10033.702, 'text': 'And that is going to equal to this.', 'start': 10030.998, 'duration': 2.704}, {'end': 10041.954, 'text': "And of course, we shouldn't forget to import the string conversion package like this.", 'start': 10034.343, 'duration': 7.611}, {'end': 10045.058, 'text': 'And everything looks fine.', 'start': 10042.835, 'duration': 2.223}, {'end': 10047.442, 'text': 'Cool So now we are creating a map.', 'start': 10045.639, 'duration': 1.803}, {'end': 10054.811, 'text': 'for each user because this book ticket function gets executed every time a new user books a ticket.', 'start': 10048.345, 'duration': 6.466}, {'end': 10061.037, 'text': 'So the map is getting created and all the user data gets saved into that map.', 'start': 10055.192, 'duration': 5.845}, {'end': 10068.144, 'text': 'So now we need to actually take that map with all the user data and add it to the bookings list.', 'start': 10061.538, 'duration': 6.606}, {'end': 10073.439, 'text': 'Right now we have a slice of strings as bookings.', 'start': 10069.136, 'duration': 4.303}, {'end': 10078.102, 'text': 'So first we need to make bookings variable into a slice of maps.', 'start': 10074.039, 'duration': 4.063}, {'end': 10083.265, 'text': "So what I'm going to do is I'm going to copy the type of this map.", 'start': 10079.142, 'duration': 4.123}, {'end': 10087.968, 'text': 'And right here.', 'start': 10087.428, 'duration': 0.54}], 'summary': 'Creating a map to store user data and adding it to the bookings list.', 'duration': 62.236, 'max_score': 10025.732, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/yyUHQIec83I/pics/yyUHQIec83I10025732.jpg'}, {'end': 10149.107, 'src': 'embed', 'start': 10118.726, 'weight': 0, 'content': [{'end': 10125.089, 'text': 'Again, the make function that we use to create a map like this.', 'start': 10118.726, 'duration': 6.363}, {'end': 10129.791, 'text': 'Note the comparison between the two make calls.', 'start': 10126.13, 'duration': 3.661}, {'end': 10137.295, 'text': 'So here, when we created a map, we have a type of the map and we wrap it into make function.', 'start': 10130.332, 'duration': 6.963}, {'end': 10140.139, 'text': 'And that creates an empty map here.', 'start': 10138.117, 'duration': 2.022}, {'end': 10141.84, 'text': "We're not creating an empty map.", 'start': 10140.259, 'duration': 1.581}, {'end': 10144.623, 'text': "We're creating an empty list of maps.", 'start': 10141.961, 'duration': 2.662}, {'end': 10149.107, 'text': "That's why we have the brackets before the map.", 'start': 10145.064, 'duration': 4.043}], 'summary': 'Using make function to create a list of maps.', 'duration': 30.381, 'max_score': 10118.726, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/yyUHQIec83I/pics/yyUHQIec83I10118726.jpg'}, {'end': 10210.527, 'src': 'embed', 'start': 10173.37, 'weight': 4, 'content': [{'end': 10179.613, 'text': 'the initial size can be one or even zero, because it will increase anyways when we add new elements.', 'start': 10173.37, 'duration': 6.243}, {'end': 10185.735, 'text': "So with this syntax, we're initializing a list of maps.", 'start': 10180.133, 'duration': 5.602}, {'end': 10195.685, 'text': 'And finally, as the last step, going back to our book ticket logic,', 'start': 10186.903, 'duration': 8.782}, {'end': 10208.107, 'text': 'we of course want to add instead of adding first name plus last name in our bookings list, we want to add user data map and save.', 'start': 10195.685, 'duration': 12.422}, {'end': 10210.527, 'text': 'There you go.', 'start': 10208.127, 'duration': 2.4}], 'summary': 'Initializing a list of maps and adding user data to bookings list in the book ticket logic.', 'duration': 37.157, 'max_score': 10173.37, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/yyUHQIec83I/pics/yyUHQIec83I10173370.jpg'}, {'end': 10395.704, 'src': 'embed', 'start': 10362.35, 'weight': 3, 'content': [{'end': 10369.454, 'text': 'So after the booking, we have a list of bookings, which is a slice you see with the brackets.', 'start': 10362.35, 'duration': 7.104}, {'end': 10373.236, 'text': 'And inside that we have one map because we just have one booking.', 'start': 10369.874, 'duration': 3.362}, {'end': 10382.841, 'text': 'And this map contains basically these key value pairs for email, first name, last name and number of tickets divided, separated by columns.', 'start': 10373.936, 'duration': 8.905}, {'end': 10384.982, 'text': "And let's try another one.", 'start': 10383.501, 'duration': 1.481}, {'end': 10395.704, 'text': 'And now our list of bookings has two maps like this.', 'start': 10391.417, 'duration': 4.287}], 'summary': 'The system stores a list of bookings in a slice with key value pairs for email, first name, last name, and number of tickets, with an example of one booking and another with two bookings.', 'duration': 33.354, 'max_score': 10362.35, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/yyUHQIec83I/pics/yyUHQIec83I10362350.jpg'}, {'end': 10526.685, 'src': 'embed', 'start': 10500.408, 'weight': 5, 'content': [{'end': 10509.117, 'text': 'So how can we save mixed data type values for an entity like a user or conference in our Go application?', 'start': 10500.408, 'duration': 8.709}, {'end': 10515.303, 'text': "Well, for that we can use what's called a struct in Go, which stands for structure.", 'start': 10509.737, 'duration': 5.566}, {'end': 10523.885, 'text': 'structs or structures let us define key value pairs for an entity like user, but with mixed data types.', 'start': 10515.923, 'duration': 7.962}, {'end': 10526.685, 'text': "So let's see how we can create a struct.", 'start': 10524.585, 'duration': 2.1}], 'summary': 'Using structs in go to save mixed data type values for entities.', 'duration': 26.277, 'max_score': 10500.408, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/yyUHQIec83I/pics/yyUHQIec83I10500408.jpg'}], 'start': 9995.889, 'title': 'Managing user tickets and data and using slices and structs in go', 'summary': 'Explains how to convert user tickets into string format, save them in a map, and add the map to the bookings list. it also covers the usage of slices and structs in go, including initializing a list of maps and transitioning to using a struct type for user data to improve code readability and manageability.', 'chapters': [{'end': 10149.107, 'start': 9995.889, 'title': 'Managing user tickets and data', 'summary': 'Explains how to convert user tickets into string format, save them in a map, and then add the map to the bookings list, emphasizing the need to create an empty slice of maps using the make function.', 'duration': 153.218, 'highlights': ['The book ticket function generates a map for each user when they book a ticket.', 'The user tickets are converted into string format and saved into a map, which is then added to the bookings list.', 'The need to create an empty slice of maps using the make function is emphasized for transitioning from a list of strings to a list of maps.']}, {'end': 10860.016, 'start': 10149.908, 'title': 'Using slices and structs in go', 'summary': 'Covers the usage of slices and structs in go, including initializing a list of maps, modifying the booking logic to store user data in a list of maps, and transitioning to using a struct type for user data to improve code readability and manageability.', 'duration': 710.108, 'highlights': ['Transitioning to using a struct type for user data to improve code readability and manageability The chapter introduces using a struct in Go to define key value pairs for entities like user with mixed data types, allowing for a predefined structure and custom data type, resulting in improved code readability and manageability.', 'Modifying the booking logic to store user data in a list of maps The chapter explains the modification in the booking logic to store user data in a list of maps, enabling the storage of different user data types like first name, last name, email, and number of tickets, in a list, and the ability to access and manipulate the data accordingly.', 'Initializing a list of maps The chapter demonstrates the initialization of a list of maps in Go, using slices to dynamically expand the list as new values are added, and the ability to add user data maps to the list for storing user information as key value pairs.']}], 'duration': 864.127, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/yyUHQIec83I/pics/yyUHQIec83I9995889.jpg', 'highlights': ['The need to create an empty slice of maps using the make function is emphasized for transitioning from a list of strings to a list of maps.', 'The book ticket function generates a map for each user when they book a ticket.', 'The user tickets are converted into string format and saved into a map, which is then added to the bookings list.', 'Modifying the booking logic to store user data in a list of maps The chapter explains the modification in the booking logic to store user data in a list of maps, enabling the storage of different user data types like first name, last name, email, and number of tickets, in a list, and the ability to access and manipulate the data accordingly.', 'Initializing a list of maps The chapter demonstrates the initialization of a list of maps in Go, using slices to dynamically expand the list as new values are added, and the ability to add user data maps to the list for storing user information as key value pairs.', 'Transitioning to using a struct type for user data to improve code readability and manageability The chapter introduces using a struct in Go to define key value pairs for entities like user with mixed data types, allowing for a predefined structure and custom data type, resulting in improved code readability and manageability.']}, {'end': 12295.957, 'segs': [{'end': 10887.911, 'src': 'embed', 'start': 10860.016, 'weight': 7, 'content': [{'end': 10864.259, 'text': 'can help me identify this error even before running the application?', 'start': 10860.016, 'duration': 4.243}, {'end': 10872.643, 'text': 'And this is because we have created a real type with a structure in which the Go compiler knows the associated properties.', 'start': 10864.919, 'duration': 7.724}, {'end': 10884.429, 'text': 'so, as you see, when working with structs, the syntax is simpler than with maps, so our code looks cleaner and less messy awesome.', 'start': 10873.303, 'duration': 11.126}, {'end': 10887.911, 'text': "so that's basically the final result of our code.", 'start': 10884.429, 'duration': 3.482}], 'summary': 'Go compiler can identify errors before running the application by using real types with structures, leading to cleaner code.', 'duration': 27.895, 'max_score': 10860.016, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/yyUHQIec83I/pics/yyUHQIec83I10860016.jpg'}, {'end': 10959.946, 'src': 'embed', 'start': 10926.376, 'weight': 12, 'content': [{'end': 10933.919, 'text': 'And again if we add another user booking like this you see one struct and another one.', 'start': 10926.376, 'duration': 7.543}, {'end': 10947.024, 'text': "Now let's say after user books a ticket, we want to generate that book ticket and send it to the user per email address that they entered.", 'start': 10937.574, 'duration': 9.45}, {'end': 10956.594, 'text': "So let's create a function called send ticket that generates a ticket.", 'start': 10950.247, 'duration': 6.347}, {'end': 10959.946, 'text': 'and then sends it per email.', 'start': 10958.286, 'duration': 1.66}], 'summary': 'Creating a function to generate and send a ticket per email after user booking.', 'duration': 33.57, 'max_score': 10926.376, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/yyUHQIec83I/pics/yyUHQIec83I10926376.jpg'}, {'end': 11041.59, 'src': 'embed', 'start': 11019.764, 'weight': 10, 'content': [{'end': 11030.658, 'text': "Now let's say instead of just printing out this string we wanted to save it into a variable called ticket that we would then send per email.", 'start': 11019.764, 'duration': 10.894}, {'end': 11041.59, 'text': 'And that may be another useful example that you may need in your applications to basically safe formatted strings in a variable instead of just printing them out.', 'start': 11031.059, 'duration': 10.531}], 'summary': 'Demonstrating how to save a formatted string into a variable for email, providing a useful example for applications.', 'duration': 21.826, 'max_score': 11019.764, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/yyUHQIec83I/pics/yyUHQIec83I11019764.jpg'}, {'end': 11105.865, 'src': 'embed', 'start': 11069.846, 'weight': 8, 'content': [{'end': 11075.948, 'text': 'So this function basically helps you put together a string just like in the formatted output here.', 'start': 11069.846, 'duration': 6.102}, {'end': 11080.27, 'text': 'But instead of printing it out you can save it into a string variable.', 'start': 11076.568, 'duration': 3.702}, {'end': 11086.332, 'text': "So we have simulated the ticket generation and now let's simulate sending it per email.", 'start': 11080.71, 'duration': 5.622}, {'end': 11105.865, 'text': "In this case we're just going to use a print statement which says sending ticket, and this is the ticket to email address,", 'start': 11086.432, 'duration': 19.433}], 'summary': 'Function generates and sends tickets via email', 'duration': 36.019, 'max_score': 11069.846, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/yyUHQIec83I/pics/yyUHQIec83I11069846.jpg'}, {'end': 11192.934, 'src': 'embed', 'start': 11163.827, 'weight': 3, 'content': [{'end': 11174.914, 'text': 'So this basically just simulates with simple code a logic for generating a ticket and then sending it to email after user booked the ticket.', 'start': 11163.827, 'duration': 11.087}, {'end': 11179.117, 'text': "So I'm going to take the name of the function and we actually have to call this right.", 'start': 11175.495, 'duration': 3.622}, {'end': 11190.833, 'text': "So, in the main function, right after book ticket gets executed, we're going to call send ticket, and this expects the variables,", 'start': 11179.637, 'duration': 11.196}, {'end': 11192.934, 'text': 'which are actually the same as here.', 'start': 11190.833, 'duration': 2.101}], 'summary': 'Simulates ticket generation and email sending after booking, using function calls and variables.', 'duration': 29.107, 'max_score': 11163.827, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/yyUHQIec83I/pics/yyUHQIec83I11163827.jpg'}, {'end': 11317.612, 'src': 'embed', 'start': 11281.215, 'weight': 9, 'content': [{'end': 11288.1, 'text': "from a time package and in a sleep function we're going to say how long it needs to sleep.", 'start': 11281.215, 'duration': 6.885}, {'end': 11293.624, 'text': 'so 10 seconds again.', 'start': 11288.1, 'duration': 5.524}, {'end': 11306.194, 'text': 'the second unit is in the time package and we of course have to import it time and there you go.', 'start': 11293.624, 'duration': 12.57}, {'end': 11314.51, 'text': "So now, whenever this function gets called, we're simulating that something happens here for 10 seconds.", 'start': 11308.126, 'duration': 6.384}, {'end': 11317.612, 'text': "So in this case, it's just slipping.", 'start': 11314.931, 'duration': 2.681}], 'summary': 'Using time package to simulate a 10-second sleep function.', 'duration': 36.397, 'max_score': 11281.215, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/yyUHQIec83I/pics/yyUHQIec83I11281215.jpg'}, {'end': 11433.057, 'src': 'embed', 'start': 11411.755, 'weight': 1, 'content': [{'end': 11420.485, 'text': 'Now, if this was an application that should handle multiple bookings of multiple users, then this would not be an optimal performance.', 'start': 11411.755, 'duration': 8.73}, {'end': 11424.049, 'text': "Right And that's why we need concurrency in applications.", 'start': 11420.565, 'duration': 3.484}, {'end': 11433.057, 'text': 'And as I mentioned at the beginning, the main advantage of Go programming language is the simplicity of coding concurrent applications.', 'start': 11424.589, 'duration': 8.468}], 'summary': 'Go programming language simplifies coding concurrent applications for optimal performance.', 'duration': 21.302, 'max_score': 11411.755, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/yyUHQIec83I/pics/yyUHQIec83I11411755.jpg'}, {'end': 11782.078, 'src': 'embed', 'start': 11752.212, 'weight': 11, 'content': [{'end': 11755.053, 'text': 'And finally for the third user.', 'start': 11752.212, 'duration': 2.841}, {'end': 11761.276, 'text': 'So our application stays responsive no matter how long this code actually takes to execute.', 'start': 11755.554, 'duration': 5.722}, {'end': 11769.288, 'text': "Now let's see one more thing about concurrency in our applications.", 'start': 11765.905, 'duration': 3.383}, {'end': 11773.011, 'text': "Let's say we did not have a for loop here.", 'start': 11770.068, 'duration': 2.943}, {'end': 11779.456, 'text': 'that keeps on asking for the new booking, which means once the booking is done, the main application would exit.', 'start': 11773.011, 'duration': 6.445}, {'end': 11782.078, 'text': 'There is no next iteration here.', 'start': 11779.616, 'duration': 2.462}], 'summary': 'Application ensures responsiveness even for lengthy code execution, demonstrating importance of concurrency.', 'duration': 29.866, 'max_score': 11752.212, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/yyUHQIec83I/pics/yyUHQIec83I11752212.jpg'}, {'end': 12157.111, 'src': 'embed', 'start': 12113.725, 'weight': 0, 'content': [{'end': 12116.706, 'text': 'or what does Go actually do better or more efficiently??', 'start': 12113.725, 'duration': 2.981}, {'end': 12122.609, 'text': "Well, in Go, when we create a thread, Go actually spins off what's called a green thread.", 'start': 12117.047, 'duration': 5.562}, {'end': 12131.233, 'text': "Green thread in Go is an abstraction of an actual thread, which is an operating system thread, and it's called a Go routine.", 'start': 12123.089, 'duration': 8.144}, {'end': 12134.915, 'text': "So with Go keyword, we're actually creating Go routines.", 'start': 12131.593, 'duration': 3.322}, {'end': 12142.56, 'text': 'So in Go, we are only interacting with these high-level Go routines instead of the low-level operating system threads.', 'start': 12135.535, 'duration': 7.025}, {'end': 12149.385, 'text': "And an advantage of working with this thread abstraction is that, first of all, it's cheaper to create,", 'start': 12143.06, 'duration': 6.325}, {'end': 12152.808, 'text': "it's more lightweight and takes little memory space.", 'start': 12149.385, 'duration': 3.423}, {'end': 12157.111, 'text': 'So each time you create a thread, you actually have way less overhead.', 'start': 12153.268, 'duration': 3.843}], 'summary': 'Go uses lightweight green threads, reducing memory overhead.', 'duration': 43.386, 'max_score': 12113.725, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/yyUHQIec83I/pics/yyUHQIec83I12113725.jpg'}, {'end': 12220.813, 'src': 'embed', 'start': 12197.261, 'weight': 6, 'content': [{'end': 12208.287, 'text': 'In contrast, GoRoutines has a concept of channels, which is a built-in functionality which allows easy and safe communication between the go routines.', 'start': 12197.261, 'duration': 11.026}, {'end': 12213.289, 'text': 'And this is a functionality that helps you handle concurrency issues,', 'start': 12208.967, 'duration': 4.322}, {'end': 12220.813, 'text': 'which are issues that may occur when threats have shared data or are dependent on each other.', 'start': 12213.289, 'duration': 7.524}], 'summary': 'Goroutines use channels for safe communication and handling concurrency issues.', 'duration': 23.552, 'max_score': 12197.261, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/yyUHQIec83I/pics/yyUHQIec83I12197261.jpg'}], 'start': 10860.016, 'title': 'Go programming essentials', 'summary': 'Covers working with structs, simulating logic, ticket generation, email sending, go programming language, concurrency, go routines, and wait groups. it also highlights the advantages of using go routines over traditional threads and hints at the upcoming advanced go course.', 'chapters': [{'end': 11018.506, 'start': 10860.016, 'title': 'Working with structs and simulating logic', 'summary': 'Explains how to work with structs in go, simplifying syntax and making the code cleaner, while also demonstrating the process of simulating logic for generating and sending tickets through a function.', 'duration': 158.49, 'highlights': ['Working with structs simplifies syntax and makes code cleaner The Go compiler recognizes the associated properties of a real type with a structure, simplifying syntax and making the code cleaner.', "Demonstrating the process of simulating logic for generating and sending tickets through a function The chapter demonstrates the process of simulating logic for generating and sending tickets through a function, including creating a function called 'send ticket' to generate and send a ticket per email.", "Printing a list of bookings and simulating ticket generation The chapter shows the output of printing a list of bookings, which is now a list of structs, and simulates generating a ticket by putting together a string for a certain user's ticket."]}, {'end': 11411.375, 'start': 11019.764, 'title': 'Simulating ticket generation and email sending', 'summary': 'Demonstrates simulating the generation of a ticket and sending it via email, including formatting a string, simulating a 10-second delay, and handling application responsiveness.', 'duration': 391.611, 'highlights': ['The chapter demonstrates simulating the generation of a ticket and sending it via email The transcript illustrates the process of simulating the generation of a ticket and sending it via email as part of an application.', 'Simulating a 10-second delay using the sleep function The code simulates a 10-second delay using the sleep function from the time package to demonstrate the handling of time delays in the application.', 'Formatting a string to save it into a variable for sending via email The chapter explains the process of formatting a string and saving it into a variable for sending via email, demonstrating the usage of s print F function for this purpose.']}, {'end': 11876.781, 'start': 11411.755, 'title': 'Go programming language and concurrency', 'summary': "Discusses the importance of concurrency in applications, highlighting the simplicity of coding concurrent applications in go programming language, and demonstrates the creation of separate threads using 'go' keyword to improve application performance, allowing multiple users to book tickets simultaneously without any interruption, and showcases the impact of not having a loop to keep the main application responsive.", 'duration': 465.026, 'highlights': ['Concurrency in applications is important for optimal performance, and Go programming language offers simplicity in coding concurrent applications compared to other languages. Highlighting the importance of concurrency for optimal performance and the advantage of Go programming language in coding concurrent applications.', "By using the 'go' keyword in Go programming language, separate threads can be created to execute logic in a separate thread, improving application performance by allowing multiple users to book tickets simultaneously without any interruption. Demonstrates the use of the 'go' keyword in Go programming language to create separate threads and improve application performance by allowing multiple users to book tickets simultaneously without interruption.", 'The impact of not having a loop to keep the main application responsive is showcased, demonstrating that without a loop, the main application exits after one booking, ignoring any additional threads and their tasks. Showcasing the impact of not having a loop to keep the main application responsive, leading to the main application exiting after one booking and ignoring additional threads and their tasks.']}, {'end': 12295.957, 'start': 11877.221, 'title': 'Working with go routines', 'summary': 'Explains how to work with go routines and wait groups in go programming, highlighting the advantages of using go routines over traditional threads in terms of efficiency, memory usage, and communication, and also hints at the upcoming advanced go course.', 'duration': 418.736, 'highlights': ['Go Routines are more lightweight and consume less memory compared to traditional threads, allowing for the creation and use of thousands of threads without affecting application performance Go Routines are more lightweight and consume less memory compared to traditional threads, allowing for the creation and use of thousands of threads without affecting application performance.', 'Go uses green threads or Go Routines as an abstraction of actual threads, making it more efficient and cheaper to create threads, which is not the case in other languages like Java Go uses green threads or Go Routines as an abstraction of actual threads, making it more efficient and cheaper to create threads, which is not the case in other languages like Java.', 'GoRoutines have a concept of channels, which is a built-in functionality for easy and safe communication between the Go Routines, helping to handle concurrency issues GoRoutines have a concept of channels, which is a built-in functionality for easy and safe communication between the Go Routines, helping to handle concurrency issues.']}], 'duration': 1435.941, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/yyUHQIec83I/pics/yyUHQIec83I10860016.jpg', 'highlights': ['Go Routines are more lightweight and consume less memory compared to traditional threads, allowing for the creation and use of thousands of threads without affecting application performance', "By using the 'go' keyword in Go programming language, separate threads can be created to execute logic in a separate thread, improving application performance by allowing multiple users to book tickets simultaneously without any interruption", 'Concurrency in applications is important for optimal performance, and Go programming language offers simplicity in coding concurrent applications compared to other languages', "The chapter demonstrates the process of simulating logic for generating and sending tickets through a function, including creating a function called 'send ticket' to generate and send a ticket per email", "Demonstrates the use of the 'go' keyword in Go programming language to create separate threads and improve application performance by allowing multiple users to book tickets simultaneously without interruption", 'Go uses green threads or Go Routines as an abstraction of actual threads, making it more efficient and cheaper to create threads, which is not the case in other languages like Java', 'GoRoutines have a concept of channels, which is a built-in functionality for easy and safe communication between the Go Routines, helping to handle concurrency issues', 'Working with structs simplifies syntax and makes code cleaner The Go compiler recognizes the associated properties of a real type with a structure, simplifying syntax and making the code cleaner', 'The chapter demonstrates simulating the generation of a ticket and sending it via email as part of an application', 'The code simulates a 10-second delay using the sleep function from the time package to demonstrate the handling of time delays in the application', 'Formatting a string to save it into a variable for sending via email, demonstrating the usage of s print F function for this purpose', 'The impact of not having a loop to keep the main application responsive is showcased, demonstrating that without a loop, the main application exits after one booking, ignoring any additional threads and their tasks', "Printing a list of bookings and simulating ticket generation, which is now a list of structs, and simulates generating a ticket by putting together a string for a certain user's ticket"]}], 'highlights': ['Go programming language designed for scalable infrastructure improvements and parallel task execution.', 'Go applications have simple syntax, fast building and execution, resource efficiency, and cross-platform deployment.', 'The chapter introduces creating a welcome message, using variables and constants for conference name and ticket count, and tracking remaining tickets in a Go conference booking application.', 'The chapter explains the concept of pointers in Golang, how they work, and their importance, demonstrating the use of pointers to store memory addresses and update variables.', 'The chapter discusses the use of arrays and slices in Go applications, emphasizing the fixed size of arrays and the need for dynamic size lists using slices.', 'The for loop in Go is the primary loop structure, simplifying the concept by catering to different use cases and eliminating the need for multiple loop types.', 'The program ends when all 50 tickets are booked, preventing further bookings and exiting the application.', 'The chapter explains the process of validating user input for email, ticket count, and city selection, employing logical conditions to ensure validity and prevent errors.', 'The process involves defining the data types of the return values and encapsulating them in separate parentheses outside the input parameters.', "The need to optimize user information storage in the application by transitioning the bookings list from a list of strings to a list of maps to store users' first name, last name, email, and number of tickets.", 'The need to create an empty slice of maps using the make function is emphasized for transitioning from a list of strings to a list of maps.', 'Go Routines are more lightweight and consume less memory compared to traditional threads, allowing for the creation and use of thousands of threads without affecting application performance.']}