The Go Syntax series was designed specifically for busy professionals who want to incrementally learn Go syntax on their spare time. You will not find lengthy projects here – just short, repeatable exercises. This is the first of three volumes.
Each of the three-volume projects are self-contained, but if you are going to do all three, this is the one to start with because it provides basic information that makes the other two volumes clearer.
What you will learn
The Go Syntax series was designed specifically for busy professionals who want to incrementally learn Go syntax on their spare time. You will not find lengthy projects here – just short, repeatable exercises. This is the first of three volumes.
Each of the three-volume projects are self-contained, but if you are going to do all three, this is the one to start with because it provides basic information that makes the other two volumes clearer.
What you will learn
To give you a more effective study environment, this course is purposefully limited in scope. Attempting to cover everything about GO would not be practical, and it would do you a disservice. However, you will learn quite a lot in a truly short time, and you can always return to repeat the exercises.
This is the first volume of a Computer Literacy Series with emphasis on the Go language, but if you are already familiar with programming and just want to see how Go syntax is written, this course has taken your prior knowledge into consideration by keeping explanations simple and to the point. It serves as a learning tool and a review tool as well.
Even if you have taken Go before, this volume is written to expand awareness on the subject.
The Go Language: Your First Code Adventure covers the fundamentals of GO in plain language, and as quickly as possible for practicality and enjoyment reasons.
When you less expect, you would have covered the following topics:
Basic syntax introduction.
Variables.
Datatypes and their purpose.
Control flow with if, else, and switch.
Basic functions, arguments, parameters.
Passing data by value.
Passing data by reference with pointers. (Great explanation)
Loops.
How to install and test GO locally.
Basic command line or terminal skills. (step by step)
How to get input data from the keyboard
How to create files and folders via the terminal.
How to create a GO file.
How to run a GO file.
How to create an executable file from GO source code.
Introduction to input output in GO and how to write to a file.
Some advanced concepts that need to be covered early on.
(Data structures will be introduced on other volumes. You will not need them for the GO exercises discussed in this volume).
Each lesson is short and to the point
I know, it is hard to return home after a long day's work and still try learning something anew. You want to study a programming language, perhaps your very first one, but at the end of the day, your energy is just not there.
So, what can you do?
First, choose a programming language that matters in 2024 and beyond, one that is not in constant morphing and deprecation.
With so many languages to choose from, what if you pick the wrong one and only discover your mistake months later? Should you go with JavaScript, Python, C#, or C? Should you select a more modern one, like the GO language from Google? So many decisions and so little time to waste.
This course will assist you in your GO learning journey. Learning Go will also help you learn other languages later.
Second, choose a short (but meaningful) course of study.
My friend, if you feel overwhelmed but still want to learn something new, this course series is for you. First, you will be learning one of the hottest languages in the planet, the Go language or Golang.Learning Go will put you ahead of the game.
But even if you don't care about language popularity and demand, the Go language is a great tool to work with because it is simple, very powerful, and contemporary. Go will also help you understand what other languages are trying to do, such as PHP, JavaScript, and Python.
Yes, being a well written language, studying Go may clear up any confusion you have about older languages you already know.
You see, many languages offer a variety of ways to accomplish a similar outcome. In contrast, Go offers a one-way to write code and write it well, and that makes the language easier to learn at first and easier to program with. It also makes you a better programmer because you have more energy to think about solutions rather than syntax.
For example, when it comes to loops, why should you learn so many keywords, such as while, do, until, for, and so on? The creators of GO decided that we only need a single keyword to declare a loop, the for keyword.
When programmers know what they are doing, they avoid unnecessary abstractions that bloat the language. You can write any other loop outcome by just using FOR. As a benefit, you will not have to memorize unnecessary commands that lead to the same outcome, and you will think more of finding solutions to help you in your professional projects.
That's simplicity at its best.
In addition, this course series takes into consideration your limited daily study time. Here, topics are written recursively and with plenty of self-contained exercises so that you don't have to start afresh when you forget things after taking a few days off.
Every concept is explained in plain language, avoiding industry jargon. If you concentrate on this a few minutes a day, you will learn and relearn how to program in GO.
Summary
And that is it, my friend. I was thinking of busy people while designing the course. It's like something I wish I had when I began my Go studies instead of spending countless hours doing extra research to discover why things worked the way they work. Time is money.
If you invest a few minutes a day in it, you will learn and grow, and you'll still have enough of your evening to enjoy quality moments with your family and friends.
Read the reviews from other students and make an investment decision- Subscribe now so we can get started. This is a joyful approach to the Go language you won't regret.
How to access the Go language Playground. How to adjust the results pane for a better Go result view
The Go syntax of a main program file. How to import a Go library. Some basic but practical concepts in Go.
How to declare and assign a variable of type string in the Go language.
Assigning variables outside of functions. Also, and introduction to the Go colon equals assignment operator.
Written explanation on the two ways of declaring a variable in Go.
Which variable declaration style should you use in Go and where should you use it.
The purpose of multi-line import declarations wrapped with parentheses.
Introduction to Printf, variable placeholders or verbs in Go, and line return commands.
Further reading material.
How to disable a line of code or making human readable comments in Go code.
In the Go language all variables declared inside of functions must be put to use before compiling.
Declaring variables of type int and float64 in Go. Further practicing with Println and Printf.
How to convert a number to a string in Go. Explicit conversions. Introduction to the strconv library.
How to get the memory address of a variable. Passing data by value, passing data by reference or by pointer. Variable referencing and dereferencing in Go.
How to assign a variable to a memory address in Go. How to dereference a pointer variable. Introducing the pointer string type.
The following quiz serves to help you cement some of the concepts before we proceed to the next topic. It has no other purpose.
Introduction to comparison operators in Go. The bool data type.
How to check the data type of a variable with the TypeOf operator. Introducing the reflect package.
How to write conditional statements in Go. Introducing if, else if, else.
Introducing the for loop in Go. Explanation of the ++ command.
Using the modulus or modulo operator in Go to find odd and even numbers.
How to use a for loop to select odd and even numbers.
Introducing Go Boolean operators. The short-circuit evaluation, also known as minimal evaluation, or McCarthy evaluation semantics of some Boolean operators.
Explanation of the FizzBuzz exercise using if conditional statements in Go.
Introducing the Switch statement in Go. There is no fall through but we can add the keyword is fall
through is needed. Code samples are available for downloading.
How to write the FizzBuzz game in a switch style in Go.
Introduction to functions in Go.
How to declare and invoke a function in Go. Function expressions and function declarations. Function naming convention. Naming identifiers for export.
Introduction to function and block scope. How to access variables from outside of the function.
How to submit data into functions via parameters. Difference between arguments and parameters. Some possible errors when submitting arguments to functions.
How to convert strings to uppercase, lowercase, and title capitalization in the Go language. Use ToLower, ToUpper, Title from the "strings" package.
This exercise converts lowercase to uppercase and it also shows that function arguments are normally passed in by value (as a copy).
How to pass arguments to a function in a way that affects the original value. Passing by reference.
Introducing the return statement in Go.
How to return two or more values from a function. How to assign consecutive values to consecutive variables.
The blank identifier allows us to ignore a value coming from a multiple value set. It prevents the code from going into error.
Preliminary information for the video that follows. Converting Fahrenheit degrees to Celsius.
This video introduces the datatype float64 in Go and explains how to declare a function that converts Fahrenheit to Celsius.
Variables being evaluated by an if conditional statement can have a global, or a block scope. In this video you will see how to limit the variable scope to the if statement where it is being used.
A switch with no test expression is an implicit true switch. How to print verbatim multi-line strings with Println.
How to write a while and do while loop in Go using the for loop keyword.
How to delay an instruction in Go so that it runs at the end of the process.
Introducing the nil value. How to reassign a variable using a pointer. Go does not have pointer arithmetic.
How to verify if you already have Go installed in your system. How to install Go. Where to get help on removing Go from a computer or any other issues.
How to create folders and files via the terminal. How to create a Go file. How to run a Go file. How to create an executable file from Go source code.
How to get input from the keyboard and save it in a variable for further manipulation. Introducing the Scan function.
Code demonstration based on the last session. How to use the terminal to create a Go file then run or build and test. Introducing the Scan function.
This video describes the outcome of two simple exercises on getting input from a user. Then, it challenges you to write the code on your own. Sample code is available to download in case you have questions about it.
How to add user input to your existing Fahrenheit to Celsius conversion.
Introduction to file creation in Go and how to write to a file using packages OS, and BUFIO. What are data streams. What's the purpose of Fprintln. The functions Create, Flush, and NewWriter.
How to create a file in Go. How to append data to an existing file. The difference between Create and OpenFile functions. Introduction to file permissions.
How to input a text line from the terminal using the Go language and then save it. Introducing os.Stdin, bufio.NewReader, and bufio.ReadString.
How to read and display text from a computer file in Go. Introducing os.Open, bufio NewScanner, as well as the functions Scan, and Text. How to display a selected number of line from a long text file.
This exercise will show you how to get an input string from the terminal and then trim any leading and trailing spaces from it. In addition, you will see how to bypass imported packages while testing your code.
This exercise picks up from the last session and adds a second input mechanism. It also illustrates to to move functionality from main into its own function.
How to get input from user, then save it to a file named by the user.
You have made it possible and I'm so glad to be part of your journey. Thank you.
OpenCourser helps millions of learners each year. People visit us to learn workspace skills, ace their exams, and nurture their curiosity.
Our extensive catalog contains over 50,000 courses and twice as many books. Browse by search, by topic, or even by career interests. We'll match you to the right resources quickly.
Find this site helpful? Tell a friend about us.
We're supported by our community of learners. When you purchase or subscribe to courses and programs or purchase books, we may earn a commission from our partners.
Your purchases help us maintain our catalog and keep our servers humming without ads.
Thank you for supporting OpenCourser.