Book Image

Hands-on with Go [Video]

By : Tarik Guney
Book Image

Hands-on with Go [Video]

By: Tarik Guney

Overview of this book

<p>Go has moved from the state of tentative to mass adoption. Its C-like speed, simplicity, and power for a growing number of systems level programming domains make it an attractive option for programmers working with older cumbersome, statically typed languages.</p> <p>This course will help you learn Go programming language by solving commonly faced problems by developers in a Recipe approach. You will start by installing Go binaries and get familiar with tools to develop application. Then you will manipulate with strings and then use them in built in constructions and built-in function constructs to create a complex value from two floating-point values. Then you will learn to perform arithmetic operation date and time along with parsing them from string values.</p> <p>Whether you are an expert programmer or a fresh starter, you will learn how various answers are programmed in Go language, which will take you to the next level in your mastering at Go. These recipes will be from concurrency in Go, performing various web programming tasks, doing system programming, reading and writing files, and many fundamental Go programming skills such as proper error handling, doing logging, and so on.</p> <p>The code bundle for this video course is available at <a style="color: #fa8d11;" href="https://github.com/PacktPublishing/Hands-on-with-go" target="blank">https://github.com/PacktPublishing/Hands-on-with-go</a></p> <h1>Style and Approach</h1> <p>In this course, we take a hands-on approach instead of theoretical knowledge about Go programming language. With the help of this course, you quickly learn how Go solves some of the very common problems you will face when you start using Go in your personal or enterprise level projects. You will be watching short, to-do-point, and concise videos that will quickly get you to the speed and help you enjoy working with Go.</p> <p>Each section is carefully selected so that the course can cater to a broader audience regardless of their background and interest. Each video first tells you about the problem and followed by an actual example that will show you how that problem is solved in Go.</p> <p>If you are learning Go, you will benefit by apprehending a ton of fundamental teachings that this course has to offer. Since all the examples will be hands-on development, you will see the results quickly.</p>
Table of Contents (11 chapters)
Chapter 7
Files and Directories
Content Locked
Section 5
Counting Lines in a File
In this video, we will be counting how many lines in a given file and displaying it on the console. - Use os.Open() function, loading the file into the memory - Use bufio.NewScanner(), counting how many lines in the file