Skip to content

Instantly share code, notes, and snippets.

@dunstontc
Last active May 23, 2018 18:42
Show Gist options
  • Save dunstontc/25945d74b32a369411f969381f95a21e to your computer and use it in GitHub Desktop.
Save dunstontc/25945d74b32a369411f969381f95a21e to your computer and use it in GitHub Desktop.
hello.go v2

hello.go

Structure

  • This is located at ~/go/src/github.com/hello on my computer`
.
├── greetings
│   └── hello.go
├── main.go
└── readme.md

Usage

# 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.")
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment