Pada tutorial ini, akan ada beberapa steps yang akan kita lakukan. Semua steps akan dijelaskan dibawah berikut.
Adapun stepsnya adalah sebagai berikut
- Inisialisasi project
- Membuat models
- Membuat HTTP Handler
- Menyambungkan aplikasi ke Database
# Delete all containers
docker rm $(docker ps -aq)
# Delete all images
docker rmi $(docker images -q)
# Delete all untagged images
docker rmi $(docker images -q --filter "dangling=true")References:
Locate the section for your github remote in the .git/config file. It looks like this:
[remote "origin"]
fetch = +refs/heads/*:refs/remotes/origin/*
url = [email protected]:joyent/node.git
Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:
| package main | |
| import ( | |
| "bufio" | |
| "errors" | |
| "fmt" | |
| "os" | |
| "os/exec" | |
| "strconv" | |
| "strings" |
| package main | |
| import ( | |
| "bufio" | |
| "fmt" | |
| "os" | |
| "os/exec" | |
| "strings" | |
| ) |
| // original from: http://mashe.hawksey.info/2014/07/google-sheets-as-a-database-insert-with-apps-script-using-postget-methods-with-ajax-example/ | |
| // original gist: https://gist.github.com/willpatera/ee41ae374d3c9839c2d6 | |
| function doGet(e){ | |
| return handleResponse(e); | |
| } | |
| // Enter sheet name where data is to be written below | |
| var SHEET_NAME = "writer"; |
| mgo.SetDebug(true) | |
| var aLogger *log.Logger | |
| aLogger = log.New(os.Stderr, "", log.LstdFlags) | |
| mgo.SetLogger(aLogger) |
| /* | |
| This function will help you to convert your object from struct to map[string]interface{} based on your JSON tag in your structs. | |
| Example how to use posted in sample_test.go file. | |
| */ | |
| func structToMap(item interface{}) map[string]interface{} { | |
| res := map[string]interface{}{} | |
| if item == nil { | |
| return res | |
| } |
| package main | |
| import ( | |
| "fmt" | |
| "log" | |
| "net/http" | |
| "net/http/pprof" | |
| ) | |
| func Sample(w http.ResponseWriter, r *http.Request) { |