Skip to content

Instantly share code, notes, and snippets.

@alphazero
Last active August 29, 2015 14:20
Show Gist options
  • Save alphazero/218244ace3b167ef1de8 to your computer and use it in GitHub Desktop.
Save alphazero/218244ace3b167ef1de8 to your computer and use it in GitHub Desktop.
Initial sketch of /.go tool chain meta-data files
# ----------------------------------
# general layout of the land
# ----------------------------------
$GOPATH/src/.go
$GOPATH/src/.go/config
$GOPATH/src/.go/vendors # for all projects
# ----------------------------------
# $GOPATH/.go/vendors sketch
# ----------------------------------
lib/mq = github.com/lib/pq@master
mgo = labix.org/v2/mgo
... etc
# ----------------------------------
# specific project 1
# uses the global version of package labix.org/mgo
# uses a project specific package hotness
# ----------------------------------
$GOPATH/src/mygofoo
$GOPATH/src/mygofoo/foo.go
$GOPATH/src/mygofoo/.go
$GOPATH/src/mygofoo/.go/vendors
# ----------------------------------
# foo.go fragment
# ----------------------------------
package mygofoo
import (
"mgo" // version spec'd in global .go
"lib/pq" // version spec'd in project specific .go
"hotness" // version spec'd in project specific .go
...
)
...
# ----------------------------------
# $GOPATH/src/mygofoo/.go/vendors sketch
# ----------------------------------
lib/mq = github.com/lib/pq@experimental // lets pretend
hotness = bitbucket.org/wiz/hotness@master
... etc
# go tool
> cd $GOPATH/src/mygofoo
> go build -vendors
using:
mgo -> labix.org/v2/mgo
lib/pq -> github.com/lib/pq@experimental
hotness -> bitbucket.org/wiz/hotness@master
# go tool can obviously allow for command line mods of the .go
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment