Go
Tutorials
How-to
- Avoid a data race
- Convert
camelCase
orPascalCase
tosnake_case
- Convert slice of strings to slice of int
- Covert
rune
toint
and vice versa - Declare Variables
- Declare constants with incrementing numbers
- Define a Module
- Document Packages
- Generate an integer in a given range
- Get the name of a function as a string
- Implement a nested
map
which works like adefaultdict
in Python - Iterate in reverse order
- Join elmenets of a slice
- Mimic
set
type with amap
- Normalize new lines (
CRLF
->LF
) - Open and close a file correctly
- Prepare for a Release
- Read a file line by line
- Read a text file
- Seed a random number generator
- Slice Tricks
- Split a string on whitespace
- Test the equality of two slices
- Transform
[]int
tostring
with one line
Discussions
- About Pointers
- Assignability
- Basic Types and Operators
- Can I omit
[packages]
ingo action [packages]
? - Can I use
++i
, instead ofi++
? - Constants
- Conversions to and from a string type
- Conversions(Type casting)
- Defining Anonymous functions within a loop
- Does Go support Python-like unpacking(or restructuring)?
- Does Go support function overloading?(functions with the same name)
- Goroutines and Threads
- How
append()
works - How
recover()
works - Integers
- Package Initialization
- Package Naming
- Passing slices by value vs by pointer?
- Representability
- Scanning with
Scanf
,Fscanf
, and the like - Scoping and Lifetime of Variables
- Semantic Import Versioning
- The
new
Function - Type Alias
- What do three dots(
./...
) mean? - Which things are addressable?
go build
vsgo install
gofmt
vsgoimports
interface
Valuespackage main
andfunc main() {}
Reference
GOPATH
- Numeric types
- Printing Verbs(like
%d
,%v
, etc) for
/range
func Fields(s string) []string
func FormatFloat
func Scan(a ...interface{}) (n int, err error)
func copy(dst, src []Type) int
func make(t Type, size ...IntegerType) Type
go get
go install
go test
go.mod
godoc
if
/else
package
andimport
recover()
Index
- Array and Slices slice/
- Constants const/
- Directory /src/container container/
- Error Handling error-handling/
- Functions and Methods func/
- Go Commands cmd/
- Go Language lang/
- Goroutines and Channels goroutine/
- Interfaces interface/
- Maps map/
- Modules modules/
- Package bufio bufio/
- Package builtin builtin/
- Package doc doc/
- Package fmt fmt/
- Package io io/
- Package log log/
- Package math math/
- Package os os/
- Package regexp regexp/
- Package runtime runtime/
- Package strconv strconv/
- Package strings strings/
- Package testing testing/
- Strings string/
- Structs struct/
- Types types/
- Variables variables/