Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/codegangsta/essential-go
/ functions
Functions
33 in github.com/codegangsta/essential-go
⨍
Functions
33
◇
Types & classes
7
↓ 2 callers
Function
Compliment
(a Animal)
interfaces/main.go:34
↓ 2 callers
Method
Name
()
interfaces/main.go:7
↓ 1 callers
Method
Author
()
pub/pages/config.go:14
↓ 1 callers
Function
LoadConfig
we will create a function called LoadConfig that will load up our JSON configuration file
json-parser/main.go:13
↓ 1 callers
Function
LoadConfig
(path string)
pub/pages/config.go:18
↓ 1 callers
Function
NewPoint
(x, y int)
types/main.go:9
↓ 1 callers
Method
Pet
()
interfaces/main.go:6
↓ 1 callers
Method
Render
(layout string, w io.Writer)
pub/pages/page.go:23
↓ 1 callers
Function
ServeStatic
(port int)
http-file-server/main.go:24
↓ 1 callers
Function
double
function declaration syntax looks like this. Functions in Go have zero or more arbitrary amount of inputs and outputs We have to annotate the types h
functions/main.go:41
↓ 1 callers
Function
double
Lets create another double function, but instead of returning a value, lets modify the value
pointers/main.go:32
↓ 1 callers
Method
load
()
pub/pages/page.go:32
↓ 1 callers
Function
parseName
Lets create a more advanced function. parseName, which will take a name as input and split it on spaces separators. The function will return 2 values,
functions/main.go:49
↓ 1 callers
Function
triple
a pointer to a type is denoted with a *
pointers/main.go:37
Method
Name
()
pub/pages/config.go:10
Method
Name
()
interfaces/main.go:18
Method
Name
()
interfaces/main.go:30
Function
NewPage
(filename string)
pub/pages/page.go:18
Method
Pet
()
interfaces/main.go:14
Method
Pet
()
interfaces/main.go:26
Method
area
()
types/main.go:19
Function
main
()
types/main.go:23
Function
main
a map is a typed key-value store in go. You can add items by specifying the key you want to associate it with. You can also look these items up later.
maps/main.go:7
Function
main
()
json-parser/main.go:24
Function
main
()
arrays-and-slices/main.go:5
Function
main
()
variables/main.go:43
Function
main
Every Command type program in Go requires you to have a 'main' function inside the 'main' package. This will be your entrypoint into the application a
your-first-go-program/main.go:22
Function
main
functions are the easiest way to abstract code in Go. and it is the primary way that packages communicate with each other
functions/main.go:10
Function
main
()
control-structures/main.go:5
Function
main
()
pub/main.go:10
Function
main
()
interfaces/main.go:39
Function
main
if you are not familiar with them, pointers can feel pretty daunting. Fortunately, Go prevents you from doing some terrible things with pointers that
pointers/main.go:15
Function
main
()
http-file-server/main.go:12