Where to store the source code files that belong to a package?
- Each file should go into a different directory
- In a single directory CORRECT
Why a package clause is used in a Go source-code file?
- It's used for importing a package
- It's used for letting Go know that the file belongs to a package CORRECT
- It's used for declaring a new function
1:
import
statement does that.3:
func
statement does that.
Where you should put the package clause
in a Go source-code file?
- As the first code in a Go source code file CORRECT
- As the last code in a Go source code file
- You can put it anywhere
How many times you can use package clause
for a single source code file?
- Once CORRECT
- None
- Multiple times
Which one is a correct usage of package clause
?
my package
package main
pkg main
Which one is correct?
- All files belong to the same package cannot call each others' functions
- All files belong to the same package can call each others' functions CORRECT
How to run multiple Go files?
- go run *.*go
- go build *go
- go run go
- go run *.go CORRECT
4: You can also call it like (assuming there are file1.go file2.go and file3.go in the same directory): go run file1.go file2.go file3.go