review
Package names must match what?
Package names must match what?
What is the exception?
The main package must have ...
The main package must have ...
Can the main package have other functions?
Public/private Question:
You have a package named stringutil.
stringutil has three files:
● a.go
● b.go
● c.go
a.go has
● func reverse(s string) string{}
Can b.go call reverse?
Public/private Question:
You have a package named stringutil.
stringutil has three files:
● a.go
● b.go
● c.go
a.go has
● func reverse(s string) string{}
Can b.go call reverse?
Can func main(){} call reverse?
What does idiomatic mean?
Import Statement
What is the import statement for the stringutil
package?
You can answer generally, giving the theory of what it would be.
Go command
How do you lookup the go commands?
Go commands
What is the difference between these go
commands:
● go build
○
○
● go install
○
○
● go run
○
○
Go commands
What does ‘go get’ do?
Go commands
What does ‘go get’ do?
Give an example of a ‘go get’ statement:
Go Workspace
What is a go workspace?
What folders does it contain?
How many of them should you have?
Go Workspace
What should be the path to your code after the
“src” folder?
Go Workspace
What should be the path to your code after the
“src” folder?
What would be the import statement to this uuid
package in your code:
goworkspace/src/github.com/yourGithubUserName/uuid/uuid.go
sha1
What is sha1?
sha1
How do we use sha1?
Answer generally, giving theory, not the specific terminal command.
sha1
What is the command for sha1 that we use at
the terminal?
Path variables
What is a path variable?
Path variables
What are the two path variables used by golang
which we’ve discussed?
Path variables
What are the two path variables used by golang
which we’ve discussed?
●
●
What’s the difference between these two?
Path variables
Name one file you can modify on a mac to add
a path variable:
Documentation
What is the website where you can find official go source
code documentation, and documentation about packages
other people have written?
Go build
Go build does what when run on a folder
containing package main?
Go build
Go build does what when run on a folder
containing a library package?
Go install
Go install does what when run on a folder
containing package main?
Go install
Go install does what when run on a folder
containing a library package?
What do each of these do?
● go version
● go env
● go help
● godoc
● go run
● go build
● go install
● go get
● go fmt
expressions vs statements
What is the difference between an expression
and a statement?