We can't find the internet
Attempting to reconnect
Something went wrong!
Attempting to reconnect
Analysis Summary
Ask yourself: “Did I notice what this video wanted from me, and did I decide freely to say yes?”
Worth Noting
Positive elements
- This video provides an exceptionally dense and accurate summary of Go's core syntax, making it a highly efficient refresher for experienced engineers.
Be Aware
Cautionary elements
- The 'impatient' framing is a common hook that may encourage a superficial understanding of complex topics like concurrency and memory management.
Influence Dimensions
How are these scored?About this analysis
Knowing about these techniques makes them visible, not powerless. The ones that work best on you are the ones that match beliefs you already hold.
This analysis is a tool for your own thinking — what you do with it is up to you.
Related content covering similar topics.
Transcript
go is a statically typed compiled language designed by Google employees for high performance web software it's known for its succinct expressive syntax and potent yet concise concurrency model today we strip down to the core of go for devs who are familiar in another language fire up your IDE and let's all become Gophers you can install go directly on go. dfdl the go CLI tool is responsible for building running and formatting go programs as well as package and workspace management so you don't need to install anything else the most common IDE for go are vs code with the go extension goand by jet brains or any editor that supports the go pleas language Server create a go file using the doo extension go is statically typed meaning the type of a variable is known at compile time and cannot change at runtime go has several basic types including int float Bull and string declare a variable with a specific type using VX inal 10 otherwise use the colon equals syntax and go will infer the type from the assigned value Go's integers and floating Point numbers come in various sizes int int 8 16 32 64 and their unsigned C counter Parts along with float 32 and Float 64 Boolean values are true or false and strings are declared using double quotes go also has complex number types complex 64 and 128 and a rune type for single utf8 characters declared with single quotes convert between primitive types by using the type as a function go supports all the common arithmetic operations including addition subtraction multiplication and division if dividing integers go will flaw the output so be sure to convert to a float if necessary suffix these operations with an equal sign to apply and assigned simultaneously brace to a power using the math. power function from the standard library to compare variables use double equals for equality and you can use all the standard less than greater than less than or equal to etc etc symbols that you find in other programming languages logical operations are also fairly standard using double Ampersand for and and double pipe for all use plus plus to increment an INT by one or minus minus to decrement by one use if else if and else statements to conditionally execute code blocks go if can include a variable assignment to execute before the condition separated by a semicolon making variable scope limited and code clean use the four keyword to create a loop with traditional C like syntax provide just a condition to create a while loop or omit the condition entirely to Loop infinitely you can use the continue keyword to skip an iteration and break to exit the loop early for Loops can also use the range keyword which iterates over elements in a variety of data structures like arrays and Maps providing both an index and a value the switch statement in go provides a cleaner Syntax for complex conditionals and unlike other languages doesn't require a break in each case Define functions using the funk keyword followed by the name parameters and return type a function can return multiple values a feature often used to return a result along with an error value parameters of the same type can be shortened Anonymous functions or function literals and closures are possible in go enabling Dynamic function generation and usage simply leave the name of the function declaration functions are first class citizens and go meaning they can be passed as parameters returned from other functions and assigns of variables code does not support default parameter values or function overloading maintaining Simplicity and predic ability in function calls utilize defer in functions to ensure certain cleanup activities like closing a file are always performed when the function exits enhancing robustness and readability in go a pointer holds the memory address of a variable declared using the asterisk type syntax declare a pointer using an asterisk followed by the type or prefix a value with an ampersand to get its address once you have a pointer you can access the value at points to using asterisk operator pointers in go are powerful but safe with no pointer arithmetic to avoid complexity and Safeguard against common mistakes go uses pass by value in function calls meaning changes to a variable in a function affect only the local version unless pointers are utilized pass a variable to a function by reference using a pointer to allow the function to modify the original variable which is efficient for large data structures typically you'll be able to tell whether a function is going to modify your data by whether it takes a pointer or not Go's composite data types arrays slices maps and structs allow you to group and manage data efficiently arrays have a fixed size while slices are Dynamic created with a make function or literals and can use a pen for growth slices are like Windows into an underlying array and changes reflect across all slices that share that array providing an efficient way to manage lists of items the zero value of a slice is nil representing a slice with zero length and capacity and no underlying array maps created with make or literals act as hash tables store in key value Pairs and can also be nil structs are product types that group diverse data types Under One Roof allowing you to create complex data structures and can also be nil when defined as pointers otherwise use an empty stru access properties of an array or slice with index notation maps by their keys or structed using dot notation as a side note you can also declare custom types that wrap Primitives using the type keyword instantiate these with a type name as a function methods in go are functions associated with a specific type and are defined with a receiver a variable representing the instance placed between the funk keyword and the method name methods can be declared on non-stroke types 2o and they operate on either values or pointers affecting mutability interfaces Define a set of methods that must be implemented by a type but leave the implementation to their respective types offering flexibility and simplified polymorphism you won't see attribute requirements in interfaces and go for this reason an interface is satisfied implicitly when a type provides all the methods declared in the interface go is duct typed so no explicit declaration is required the empty interface defined by the any keyword is crucial in go as it can hold any value providing a way to handle diverse types in a unified manner use type assertion with a switch statement to check the underlying type of an interface and I think you should switch on that subscribe button and the notification Bell just go promotes explicit error checking using the error type which is usually returned by function calls error is a buil-in interface that defines the method error that returns only a string making it easy to Define your own custom error values to Signal an error return a non-nil error value and handle it explicitly in your code to ensure robustness and Clarity common practice involves returning a result and an error value where the caller checks the error so get used to typing if error does not equal nil in your code use the errors package to construct simple error messages and create custom error types for more complex scenarios the Panic keyword will immediately exit the current process this is generally used at the top level of a program or as an absolute Last Resort if the error is unrecoverable however you can use the recover keyword inside a deferred function to catch the Panic message and prevent a forced exit in go a package is a collection of source files in the same directory that are compiled together it's a way to group and encapsulate code promoting modularity and reusability create a package by declaring the package name at the top of your go files and organizing them in a dedicated directory any identifier variable type or function within a package with a capitalized first letter will be exported whereas all others will be private and only accessible within the package that declares them a package can span multiple files and if you're within the same package you do not need to import anything from another file explicitly to use any external package declare it at the beginning of your file with the import statement the go standard Library encompassing a range of packages like fum and net provides robust functionalities eliminating the need for a plethora of thirdparty libraries it's very extensive including packages for Json passing and everything you need to create a web server from scratch print and format output with the fumed package from the standard Library f. println adds a new line character automatically and converts variables to Strings as needed providing a straightforward way to Output values fprint F on the other hand allows detailed formatting using verbs such as percent V for the default format percent t for booleans ccent d for integers perent f for floats and percent s for strings to concatenate strings and variables use either Plus or f.s printf which formats according to a format specifier but Returns the resulting string instead of printing it concurrency and go is a first class citizen implemented through go routines and channels a go routine is a lightweight thread managed by the go runtime born a go routine by using the go keyword followed by a function invocation this can be an immediately invoked function invocation if you need to capture variables from a surrounding scope channels provide a way for two go routines to synchronize execution and communicate by passing a value of a specified type channels are cues so messages passed in will exit in the same order to create a channel use the make function and utilize the arrow syntax to send and receive values a function can optionally receive a readon or write only version of the same channel using the aror syntax use this for elegant secure API design the select statement allows a go routine to wait on multiple communication operations enhancing synchronization and State Management with the sync package utilize mutex and weight group to manage State and synchronize execution across go routines add to a weit group with the add method subtract from it using DOD and wait until all routines have called Doone using we Go's approach to concurrency through go routines and channels offers a straightforward efficient and scalable model to handle concurrent programming paradigms and data communication and just as a quick side note I'm currently hiring for a fullstack developer so if you think you have what it takes to build a small property Tech startup in central London using go typescript python rust you can apply with the link in the description and if I haven't convinced you to give go ago you might like to Learn Python instead and you can learn all of python in under 8 minutes using this video here
Video description
For some reason, you need to learn Go, and you need to learn it NOW. Well, this video will help! Join me as we blitz through everything you need to know to Go! Want a job? Come and join me! https://withpluto.notion.site/Full-Stack-Engineer-52906b349d404772ab3f3055aaaf30fc?pvs=4 Resources: Download: https://go.dev/dl Playground: https://go.dev/play __________________________________________ Check out my other socials! 🐦 Twitter ▶ https://twitter.com/IsaacHarrisHolt 🖥️ Portfolio ▶ https://ihh.dev 📝 Blog ▶ https://isaacharrisholt.com __________________________________________ Timestamps: 00:00 - What is Go? 00:16 - Installation and setup 00:33 - Variables and data types 01:17 - Operators 01:52 - Control flow 02:30 - Functions 03:09 - Pointers and references 03:48 - Composite data types 04:40 - Methods and interfaces 05:29 - Error handling 06:15 - Packages and importing 07:04 - Printing and formatting output 07:34 - Concurrency 08:39 - Join me! #go #softwareengineer