- This is located at
~/go/src/github.com/hello
on my computer`
.
├── greetings
│ └── hello.go
├── main.go
└── readme.md
# to run
go run main.go
# to build
go build main.go
package greetings | |
import ( | |
"fmt" | |
) | |
// Hello prints out a sentence. | |
func Hello(sentence string) { | |
fmt.Printf("%s\n", sentence) | |
} |
package main | |
import ( | |
"github.com/dunstontc/hello/greetings" | |
) | |
func main() { | |
greetings.Hello("Each package gets its own directory.") | |
} |