Sunday, 10 May 2015

Go, Docker, Joyent, and New Relic

Go, Docker, Joyent, and New Relic IN PROGRESS

  • Go Language Installation: 
    • Download and install GoLang installer here
    • Download and install Go Tools to /usr/local/go and include /usr/local/go/bin in PATH env and restart terminal
 $ mkdir $HOME/code/workspace_go
 $ export GOPATH=$HOME/code/workspace_go
 $ export PATH=$PATH:$GOPATH/bin
    • Create Base Path
$ mkdir -p $GOPATH/src/
    • Create First Program
$ mkdir $GOPATH/src/
    • Create hello.go file (ready to use the reverse.go Package dependency)

package main 

import (

func main() {
fmt.Printf(stringutil.Reverse("!oG ,olleH\n"))
    • Build and Run binary to test Go Tool installation success

        $ go install

        $ $GOPATH/bin/hello
    • Setup Git Repo

$ cd $GOPATH/src/
$ git init
$ git remote add origin
$ git add --all .
$ git commit -m "Initial commit"
$ git pull origin master
$ git push origin master
    • Write Go library (with Package directory)
$ mkdir $GOPATH/src/
    • Create Package dependency stringutil reverse.go and test compilation success 
      • Note: 'go install' produces an output file, placing the package object inside the pkg directory of the workspace)
$ go build
    • Install hello.go program using the Go Tool to install the reverse.go Package and other dependencies
$ go install
    • Create reverse_test.go file with functions to be run by the Go Testing Framework and Package and Run Go Test
$ touch $GOPATH/src/$ go test 

  • 50% READ Docker New Relic Preview Edition
  • 50% READ Programming in Go
  • TODO Orchestrating Docker
  • TODO The Go Programming Language

No comments:

Post a Comment