Go
Tutorials
How-to
- Avoid a data race
- Convert
camelCaseorPascalCasetosnake_case - Convert slice of strings to slice of int
- Covert
runetointand 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
mapwhich works like adefaultdictin Python - Iterate in reverse order
- Join elmenets of a slice
- Mimic
settype 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
[]inttostringwith 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
newFunction - Type Alias
- What do three dots(
./...) mean? - Which things are addressable?
go buildvsgo installgofmtvsgoimportsinterfaceValuespackage mainandfunc main() {}
Reference
GOPATH- Numeric types
- Printing Verbs(like
%d,%v, etc) for/rangefunc Fields(s string) []stringfunc FormatFloatfunc Scan(a ...interface{}) (n int, err error)func copy(dst, src []Type) intfunc make(t Type, size ...IntegerType) Typego getgo installgo testgo.modgodocif/elsepackageandimportrecover()
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/