MCPcopy Create free account

hub / github.com/codegangsta/essential-go / functions

Functions33 in github.com/codegangsta/essential-go

↓ 2 callersFunctionCompliment
(a Animal)
interfaces/main.go:34
↓ 2 callersMethodName
()
interfaces/main.go:7
↓ 1 callersMethodAuthor
()
pub/pages/config.go:14
↓ 1 callersFunctionLoadConfig
we will create a function called LoadConfig that will load up our JSON configuration file
json-parser/main.go:13
↓ 1 callersFunctionLoadConfig
(path string)
pub/pages/config.go:18
↓ 1 callersFunctionNewPoint
(x, y int)
types/main.go:9
↓ 1 callersMethodPet
()
interfaces/main.go:6
↓ 1 callersMethodRender
(layout string, w io.Writer)
pub/pages/page.go:23
↓ 1 callersFunctionServeStatic
(port int)
http-file-server/main.go:24
↓ 1 callersFunctiondouble
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 callersFunctiondouble
Lets create another double function, but instead of returning a value, lets modify the value
pointers/main.go:32
↓ 1 callersMethodload
()
pub/pages/page.go:32
↓ 1 callersFunctionparseName
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 callersFunctiontriple
a pointer to a type is denoted with a *
pointers/main.go:37
MethodName
()
pub/pages/config.go:10
MethodName
()
interfaces/main.go:18
MethodName
()
interfaces/main.go:30
FunctionNewPage
(filename string)
pub/pages/page.go:18
MethodPet
()
interfaces/main.go:14
MethodPet
()
interfaces/main.go:26
Methodarea
()
types/main.go:19
Functionmain
()
types/main.go:23
Functionmain
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
Functionmain
()
json-parser/main.go:24
Functionmain
()
arrays-and-slices/main.go:5
Functionmain
()
variables/main.go:43
Functionmain
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
Functionmain
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
Functionmain
()
control-structures/main.go:5
Functionmain
()
pub/main.go:10
Functionmain
()
interfaces/main.go:39
Functionmain
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
Functionmain
()
http-file-server/main.go:12