Welcome to tutorial no. 2 of our WebAssembly tutorial series. Series Index Introduction to WebAssembly Using Go Accessing DOM from Go using Javascript In the first tutorial of this tutorial series, we created and exposed a function from Go and called it using JavaScript. I highly recommend reading the first part first part if you have not read it yet. In this tutorial, we will develop a UI for our application, handle errors and also manipulate the DOM of the browser from Go.| Go Tutorial - Learn Go from the Basics with Code Examples on golangbot.com
Welcome to tutorial number 7 in Golang tutorial series. What are packages and why are they used? So far we have seen Go programs that have only one file with a main function and a couple of other functions. In real-world scenarios, this approach of writing all source code in a single file is not scalable. It becomes impossible to reuse and maintain code written this way. This is where packages are helpful.| Go Tutorial - Learn Go from the Basics with Code Examples on golangbot.com
Welcome to tutorial no. 34 in Golang tutorial series. What are first class functions? A language that supports first class functions allows functions to be assigned to variables, passed as arguments to other functions and returned from other functions. Go has support for first class functions. In this tutorial, we will discuss the syntax and various use cases of first class functions. Anonymous functions Let’s start with a simple example which assigns a function to a variable.| Go Tutorial - Learn Go from the Basics with Code Examples on golangbot.com
Welcome to tutorial no. 14 in Golang tutorial series. Strings deserve a special mention in Go as they are different in implementation when compared to other languages. What is a String? A string is a slice of bytes in Go. Strings can be created by enclosing a set of characters inside double quotes " ". Let’s look at a simple example that creates a string and prints it. 1package main 2 3import ( 4 "fmt" 5) 6 7func main() { 8 name := "Hello World" 9 fmt.| Go Tutorial - Learn Go from the Basics with Code Examples on golangbot.com
Welcome to the part 11 of Golang tutorial series. In this tutorial, we will learn about Arrays and Slices in Go. Arrays An array is a collection of elements that belong to the same type. For example, the collection of integers 5, 8, 9, 79, 76 forms an array. Mixing values of different types, for example, an array that contains both strings and integers is not allowed in Go. Declaration An array belongs to type [n]T.| Go Tutorial - Learn Go from the Basics with Code Examples on golangbot.com
type Value ¶| pkg.go.dev
func Marshal ¶| pkg.go.dev