0. Prepare your github project containing go app
this is mine: https://github.com/ytkang/golang_chat_bot
for newbee, important thing is your folder is going to be under src folder. so, there is no src or pkg folder in github (related go structure).
if you already have $GOPATH just skip #1, 2
1. Make some folder whatever you named, I named it "go"
2. Set gopath
3. Login to heroku
you should install this first.
4. Get your project into this folder
go>$go get github.com/ytkang/golang_chat_bot
then, whatever there is an error or not,
"go/src/github.com/ytkang/golang_chat_bot" folder is created.
if you got an import like error when you "go get" then, It will be something occurred from your own module.
you should change your import path to solve this.
if you have folder and files like this,
and if chat.go imports jarvis.go, then it should be like this
import github.com/ytkang/jarvis O
import ./jarvis X
4. Deploy to heroku!
go/src/github.com/ytkang/golang_chat_bot>$git push heroku master
if you got "reject" error something like "failed to detect set buildpack" then you should add "godep"
How to godep
- $go get -u github.com/tools/godep // install
- go/src/github.com/ytkang/golang_chat_bot>$godep save // make godep after this you got Godep folder
- go/src/github.com/ytkang/golang_chat_bot>$git add -A; git commit -am "godep added" // important! you should apply this to your github
(after this, retry git push heroku master command. It should work!)