Table of Contents
Golang Topics
Return to Golang, Programming topics, Google topics
“Go is an open source programming language that makes it easy to build simple, reliable, and efficient software.” Fair Use Source: https://go.googlesource.com/go
“Go is a programming language built to resemble a simplified version of the C programming language. It compiles at the machine level. Go was created at Google in 2007 by Robert Griesemer, Rob Pike, and Ken Thompson.” Fair Use Source: https://github.com/topics/golang
A
B
C
D
adding lines during, 218-219
definition and overview of, 213
delve, using for, 221-224
fmt package, using for, 219, 222
GNU Debugger, using for, 224-225
of HTTP requests, 266-268
logging role in, 214, 216
test role in, 226
tool, selecting, 225
of web servers, 246
DecodeFile function, 301
default case, 61-62
default value, 91-93, 100
defer (defined), 53
defer statement, 66-69, 297
delve, 221-226
dependencies, 178-180, 183, 340
Developer Tools, 142-143
dictionary (term), 78, 80
directory, listing, 290, 295-296
disasters, handling, 129
disk, reading from, 140, 142, 154
distributed programming, 1
Docker, 334-336, 339-340
documentation, 195-198
dot notation
data accessing with, 84, 90, 101
sphere, working with, 104
values, assigning with, 85-87
dynamically typed languages, 13-14, 26
E
echo function, 222-223, 225
elapsed real time (term), 317
elements, forming collection of, 21
else if statement, 57-58, 60-61, 68
else statement, 55-57
encoding/json package, 285, 287
encoding standards, 122
English-language special characters, 116, 122-123
environment, 8, 329-331, 340
Errorf method, 133
error log, 213
errors
checking, 137
creating, 132-133
formatting, 133-134
handling, 15, 129-131, 137-138
logging, 214-215
returning from function, 134-135
type, understanding, 132
and usability, 135-136
writing, 242
errors package, 132-133
exit codes and meanings, 228
exiting, preventing process from, 163
F
fatal error, 215
file
as block, 35, 40
configuration, managing with, 299-300
copying, 296-298, 303
creating, 290, 292-294
deleting, 298-299
downloading, 336-338
existence, checking on, 303
importance of, 289-290
managing in directory, 227
name, 295-296
reading, 130-131, 140, 290-291
reformatting, 187
writing logs to, 216-217
writing to, 290, 294-295
file permissions, 213, 292-294, 295-296, 303
FindAllString function, 313
flag package, 232-235, 239
FlagSets, 237
floats, 20-21
flow control, 161-163
fmt package, 133, 219-222, 225-226
for loop, 167-169, 171
for statement, 62-66
4-bit integers, 18-19, 26
404s, 248-249
framework libraries, 257
FreeBSD, 4
French, Renee, 10
func keyword, 42
function
arguments and types, modifying for, 51
creating and calling, 43-44
definition and overview of, 41-42
errors, returning from, 134-135
method compared to, 101, 105, 113
passing as argument, 52
passing as value, 49-50
results, returning, 42-45
functional tests, 200
function arguments, 164
function signature, 41, 46-47
G
gdb, 224-225
GET requests, 255-258, 261-262, 266, 272
git command, 235
Github account, 8
Github API, 273, 285
GMT, 326
GNU Debugger, 224-225
GOARCH environment variable, 331
go build, 9-11, 229-230
go clean, 9
Go (Golang) description and overview, 1, 3-4
godoc, 192-197
GoDoc site, 197
go env command, 329-330, 340
gofmt
conventions, 197
golint compared to, 190-191
overview of, 186-187
plugins running on, 188
remembering to use, 196
go get command, 177-179, 183, 338-339
Go Gopher, 10-11
go install, 242
go keyword, 151-152
golint, 190-192, 196
“Goodbye Cruel World” value, 223, 225
Google, 3-4
Google Chrome Developer Tools, 260
GOPATH variable, 6-8
Go projects, directory structure for, 6-7
Goroutines
advantages of, 139, 153-154
Channels compared to, 171
communications between, 155-156
communication with, 159, 168
concurrent operations, handling with, 145, 161
defining, 152
execution, pausing, 327
flow control alternatives to, 163
HTTP requests, aid in making, 271
latency, managing with, 147-152
managing, 156-157
go run, 9-11
go set, 242
go test command, 201
got want pattern, 203-204
graphical user interfaces (GUI), 227
greeting, returning, 202-204
Greeting function, 204-206
Griesemer, Robert, 3
guessing game, 218-219
H
Half function, 135
HandleFunc method, 244, 247
Handler, 248-249
handler functions, 247-249
hash (term), 78, 80
header, setting, 249-250
“Hello World” file, 240-241
HelloWorld function, 244, 252
“Hello World” program, 8-9, 173
“Hello World” value, 223
“Hello World” web server, 243-249
help text, 234-239
html package, 315
HTTP (Hypertext Transfer Protocol)
complexity of, 271
definition and overview of, 259-261
JSON received over, 285-286
scraping, 311-312, 315
HTTP clients, 267, 271-272
HTTP header, 250
http package, 257
HTTP requests, 259-261, 264-268, 271
HTTP servers
creating, 243-245, 249-250, 253-254
data and requests sent to, 255-258
response to clients, 251
HTTPS server, 258
I
identifiers, uppercase versus lowercase letters starting, 183
idiomatic Go
defined, 185
error handling and, 130-131
golint aid in learning, 191
interface naming, 198
idiomatic variable, 33
if statement, 53-55, 69, 219
import statement, 174, 176
incorrect type, passing, 16-17
index, accessing array element with, 81
init statement, 63-64
inner blocks, 34
inputs and outputs, 228-229
installing Go, 4-8
integers, 15-16, 18-20, 45-46
integration tests, 200
interfaces, 109-113, 189, 198
international characters, 122-123, 127
interpreted string literals, 115, 116-117, 127
ioutil package, 290-298, 303
J
Java (programming language), 10, 138, 152, 192-193
javadoc, 192-193
JavaScript (programming language), 4, 13, 15, 286-287
JSON
advantages of, 286
APIs, 275
data posted as, 264
data types, 283-285
decoding, 281-282, 286
description and overview of, 273-274
encoding, 286
fields, mapping, 287
files, 299-300
HTTP, received over, 285-286
HTTP server sending, 249-250, 259
requesting data as, 267-268
string, 263
TOML compared to, 301, 303
using with Go, 275-281
K
key names, 278
L
languages, non-English, 126, 204-206
languages, programming, 9, 13, 89, 155-156
See also specific language, e.g.: Python (programming language)
latency, 147-152
lexical (defined), 33-34
lexical scoping, 33-34
LICENSE file, 182
Linux, 4-5, 7-8, 340
list command, 225
ListenAndServe method, 244, 258
ListenAndServeTLS method, 258
logging, 213-217, 226
logical operators, 59-60
log package, 215-216, 226
looking for a needle in a haystack, 305-306
looping, 62-63
lowercase, 124, 174, 183, 188, 278
M
macOS, 4, 5, 7-8
main package, 174
make builtin function, 80
Makefile, 196-197
malicious web server, 338
maps, 78-80
Marshal function, 275-276
MatchString function, 306
mathematical operations, 13, 21
math package, 189-190
memory, 25, 39, 155-156
memory address, 35-38
messages and messaging
advantages of, 156
to Channels, 157-160, 171
between Goroutines, 170
response to, 167
methods, 101-103, 105-109, 113-114
method sets, 103-105
monotonic clock (concept), 317
multiplayer games, 142
multiple defer statements, 67-69
multiple values, function returning, 44-45, 51
multiple variables, 220
MustCompile function, 316
MySQL database, 112-113
N
named return values, 46-48
names, key, 278
names beginning with uppercase letter, 100
naming conventions, 188-190
nesting structs, 89-91, 99
.NET, 178
net/http package, 243-244, 261-262, 264
network, 141, 154
network latency, 147-150, 152
network programming, 1, 51
Network Time Protocol (NTP), 318-319, 326-327
NewAlarm function, 92
NewDecoder function, 285
NewFlagSet, 236, 242
new keyword, 87-88
NewRequest method, 272
Nginx, 152, 213-214
Node.js, 3, 152, 178, 186
non-blocking code, 147
NotFound method, 249
numbers, determining if odd or even, 42
numeric notation, 292-293
numeric types, 18-19, 21, 25
O
object-oriented language, 112
omitempty struct tag, 287
OpenFile function, 297
Open function, 297
Open Source blogging engine, 214
Open Source Licenses, 182
Open Source projects, 186, 197
operating system, 227, 329
operators, 68
OR logical operator, 69
os package, 230, 234, 303
outer blocks, 34
P
package level block, 40
package managers, 178, 339
packages, 173-182
panic, using, 136-138
parallelism, 141-142
Pascal Case, 189
pausing process, 320, 327
permissions, 213, 292-296, 303
Pi constant, 174
Pike, Rob, 3, 4, 10, 122, 138, 142, 154
Plan 9 operating system, 3
platform, 331-332
pointer, 35-38, 96-100, 105-109
pointer reference, 106-109, 113
polymorphism (defined), 113-114
POSIX compliance, 239
postData variable, 263
POST requests, 255-258, 262-264, 272
post statement, 63-64
PowerOn method, 109-111
Printf function, 220
private values, 95
process, running indefinitely, 162-163
programming languages, 9, 13, 89, 155-156
See also specific language, e.g.: Python (programming language)
program speed, factors affecting, 140-141, 151-152
public values, 95
Python (programming language), 3-4, 13, 178
Q
Quickfix menu, 191
R
range clause, 64-66
raw command-line arguments, 229-230
raw string literals, 117-118, 235
Readfile function, 130-131, 291
README file, 182
real time (term), 317
receiver function, 160
recursive functions, 48-49, 51
reflect package, 22-23, 26
regex package, 306
regular expressions
case sensitivity in, 315
data, parsing with, 311-315
data, transforming with, 309-311
definition and overview of, 305-307
end of line, character signifying, 316
strings package compared to, 315
syntax, 307-308, 315
validation, using for, 308-309
Remove function, 298
request, setting on custom header, 271
requests, types of, 253-254, 256
requests and responses, examining, 245-247
response, status code of, 271
response speed, factors affecting, 269
responseTime function, 148
ResponseWriter, 258
return values, 134, 138
Reverse function, 176
Robot interface, 109-112
robots.txt file, 214
routing, 247, 257
Ruby (programming language), 4, 178
rune literals, 116-118
runtime errors, 213
S
sayHello function, 14-15
Schaaf, Herman, 127
scope (defined), 33
security issues, 183, 255, 337, 338, 340
select statement, 164-171
sequential tasks, 139-142
server security issues, 255-258
SGOPATH, 177, 183
short functions, 51
shorthand variables, 29-30
short variable, 32, 40
short variable assignment, 88-90
signed integers, 19-20
single result, function returning, 42-44
64-bit floats, 21
64-bit integer, 20
sleeping, 319-320, 327
slice
adding elements to, 74-76, 81
of bytes, 291
copying elements from, 77
defined, 73, 78
deleting elements from, 76, 80
length limit, 80
methods associated to, 114
numbers variables containing, 45
testing, use in, 206
using, criteria for, 80-81
working with, 73-74
slowFunc function, 144-146, 158
slowFunc method, 158-159
software, sharing, 339-340
sort comand, 227-228
source code, 39
space, trimming, 125-126
special characters, 116, 122-123, 127
Specification, 199
spheres, 103-104
Sqrt function, 189-190
square root, 190
Standard Error, 242
Standard Input (defined), 229
Standard Output (defined), 229
statically typed languages, 14, 26
strconv package, 23-24
string literals, 115-118, 127
strings
array elements, assignment to, 72
concatenating, 118-121, 126-127, 207-209
converting to and from, 21, 23, 120, 174
creating, 121, 127, 291
definition and overview of, 15, 21, 122-123, 126
format, representing time in, 322-323
lowercase, changing, 124, 174
number types distinguishing from, 25
parsing, 322-323
as programming building block, 115
searching for, 306-307
variable initializing with type of, 27-28
working with, 123-126
written to file, 294
strings package, 125, 174-175, 195, 315
stringutil package, 176, 179
strongly typed languages, 13-14, 26
struct
checking type of, 94-95
comparing, 93-95
copying, 96-99, 100
creating, 99, 206, 276, 286
data encoded to and from, 287
data type in, 100
decoding to JSON, 281-282
default value, creating for, 91-93
definition and overview of, 83-85
empty, encoding to JSON, 280-281
empty fields, omitting, 280-281, 287
encoding as JSON, 276-278
equivalence, testing for, 94
exporting, 100
initializing, 84-89
nesting, 89-91, 99
tags, 278-280, 287
time, 323-325
values, printing, 220-221
subcommands, 235-239
Sub method, 324
subslice, 80
substring, searching for, 124-125
switch statements, 60-62, 68, 164
systems programming, 1
T
tab, representation of table of binary operators table of bitwise operators table of comparison operators table of escape sequences table of keywords table of predeclared names table of Printf verbs table of UTF-8 encodings table, Sizeof table-driven testing table tests tag, struct field tagless switch statement tags, build targets TCP socket tax code techniques, in-place slice tempconv example tempconv example package temperature conversion example tempflag example template, | in template action,
Range
Return to X, Kotlin glossary, Programming glossary, Kotlin, range Function, Functions-Methods, Standard Libraries
Research It More
- range on DuckDuckGo
Fair Use Sources
Functions and Methods: Bash Functions, C Function, C++ Functions, C# Functions, , Clojure Functions, COBOL Functions, Fortran Functions, Golang Functions, Haskell Functions, Java Methods, JavaScript Functions, Kotlin Methods, Oracle PL/SQL Functions, Python Functions, PowerShell Functions, Scala Functions, Swift Functions, T/SQL Functions. (navbar_functions)
Functions and Methods: Bash Functions, C Function, C++ Functions, C# Functions, , Clojure Functions, COBOL Functions, Fortran Functions, Golang Functions, Haskell Functions, Java Methods, JavaScript Functions, Kotlin Methods, Oracle PL/SQL Functions, Python Functions, PowerShell Functions, Scala Functions, Swift Functions, T/SQL Functions. (navbar_functions)
© 1994 - 2024 Cloud Monk Losang Jinpa or Fair Use. Disclaimers
SYI LU SENG E MU CHYWE YE. NAN. WEI LA YE. WEI LA YE. SA WA HE.
© 1994 - 2024 Cloud Monk Losang Jinpa or Fair Use. Disclaimers
SYI LU SENG E MU CHYWE YE. NAN. WEI LA YE. WEI LA YE. SA WA HE.
template API template, dot . in template.Funcs method template.HTML type template.Must function template.New function template.Parse method temporary directory temporary file Terraform test assertion test, black-box test, brittle test, character test coverage test dependency, cyclic Test-Driven Development (TDD) test, echo test failure message test files, placement of Test function test, integration test of word example test package, external test, string test, white-box _test.go file testing testing a command testing package testing, randomized testing, table-driven testing.B type testing.T type (*testing.T).Errorf method (*testing.T).Fatal method tests, running tests, writing tests, writing effective text editor text/scanner package text string text/tabwriter package text/template package third-party dependencies third-party Go plugins third-party packages third-party tools Thompson, Ken Thompson, Ken, Preface thread thread-local storage three-D surface figure thumbnail example thumbnail example package thumbnail sequence diagram ticker, using time time package time.After function time.AfterFunc function time.Duration type time.Minute constant time.Now function time.Parse function time.Second constant time.Since function time.Sleep method time.Tick function time.Time type time.Time.Format method timeout timers time structs time zone differences 32-bit floats 32-bit integer title example title function titles, writing to terminal token-based decoder API token-based XML decoding ToLower function TOML files tool, go tool, go doc tool, godoc, Preface tool, gofmt tool, goimports tool, golint topological sort algorithm topoSort example ToUpper method trace example trace, stack tree, binary treesort example triangle true boolean constant tuple assignment tuple assignment types checking converting between type ←chan T, receive-only channel type chan← T, send-only channel number of overview of type switch, case in type switch, default case in type, abstract type, aggregate type, array type assertion type assertion, interface type assertion, ok value from type, bool type, bufio.Scanner type, byte type, bytes.Buffer type, Celsius type, chan type, channel type, complex type, composite, Preface type composition, Preface type, concrete type declaration type, displaying methods of a type, empty interface type, error built-in type, Fahrenheit type, function type, http.HandlerFunc type, http.Request type, http.ResponseWriter type, int type, interface{} type, interface type, interface{} type, interface dynamic type, json.Decoder type, json.Encoder type keyword type, map type, method receiver type mismatch type, named type, net.Conn type, net.Listener type, numeric type, *os.File type, os.FileInfo type, os.LinkError type, os.PathError type, recursive type, reference type, reflect.StructTag type, reflect.Type type, reflect.Value type, rune type, slice type, sort.IntSlice type, strings.Reader type, strings.Replacer type, struct type, struct{} type switch statement type, sync.Mutex type, sync.Once type, sync.RWMutex type, sync.WaitGroup type, syscall.Errno type, template.HTML type, testing.B type, testing.T type, time.Duration type, time.Time type, uint type, uintptr type, underlying type, unidirectional channel type, unnamed struct type, unsafe.Pointer type, url.URL types, untyped constant working with
U
UDP socket Unicode encoding scheme Unit Tests uint type uintptr type unary operator - unary operator + unbuffered channel undefined behavior underlying array underlying type Unicode code point Unicode escape unicode package unicode.IsDigit function unicode.IsLetter function unicode.IsLower function unicode.IsSpace function unicode.IsUpper function Unicode replacement character unicode/utf8 package Unicode standard unidirectional channel type union, discriminated universe block Unix domain socket UNIX operating system The Unix Programming Environment (Thompson) unmarshaling JSON unnamed struct type unnamed variable unreachable statement unsafe package unsafe.AlignOf function unsafe.Offsetof function unsafe.Pointer conversion unsigned integer (defined) unsigned integer unsafe.Pointer type unsafe.Pointer zero value unsafe.Sizeof function uppercase untyped constant types unused parameter URL URL escape url.QueryEscape function url.URL type urlvalues example usability, errors and User Story UTF-8 UTF-8 encoding scheme UTF-8 encodings, table of utf8.DecodeRuneInString function utf8.RuneCountInString function utf8.UTFMax value
V
W
X
Z
External sites
- https://en.wikipedia.org/wiki/Go_(programming_language)
Wikipedia
- Snippet from Wikipedia: Go (programming language)
Go is a statically typed, compiled high-level general purpose programming language. It was designed at Google in 2009 by Robert Griesemer, Rob Pike, and Ken Thompson. It is syntactically similar to C, but also has memory safety, garbage collection, structural typing, and CSP-style concurrency. It is often referred to as Golang because of its former domain name,
golang.org
, but its proper name is Go.There are two major implementations:
- The original, self-hosting compiler toolchain, initially developed inside Google;
- A frontend written in C++, called gofrontend, originally a GCC frontend, providing gccgo, a GCC-based Go compiler; later extended to also support LLVM, providing an LLVM-based Go compiler called gollvm.
A third-party source-to-source compiler, GopherJS, compiles Go to JavaScript for front-end web development.