Browse Source

Respond to pull request feedback

Zane Kansil 10 years ago
parent
commit
554075e563

+ 0 - 4
frameworks/Go/goji/bash_profile.sh

@@ -1,4 +0,0 @@
-# Set the root of our go installation
-export GOROOT=${IROOT}/go
-
-export GOPATH=${TROOT}

+ 0 - 0
frameworks/Go/goji/benchmark_config → frameworks/Go/goji/benchmark_config.json


+ 12 - 0
frameworks/Go/goji/install.sh

@@ -1,3 +1,15 @@
 #!/bin/bash
 
+
 fw_depends go
+
+export GOROOT=${IROOT}/go
+
+export GOPATH=${TROOT}
+
+# Where to find the go executable
+export PATH="$GOROOT/bin:$PATH"
+
+go get github.com/go-sql-driver/mysql
+go get github.com/zenazn/goji
+go get github.com/zenazn/goji/web

+ 4 - 6
frameworks/Go/goji/setup.sh

@@ -1,12 +1,10 @@
 #!/bin/bash
 
-# sed -i 's|tcp(.*:3306)|tcp('"${DBHOST}"':3306)|g' src/hello/hello.go
+export GOROOT=${IROOT}/go
+
+export GOPATH=${TROOT}
 
 # Where to find the go executable
 export PATH="$GOROOT/bin:$PATH"
 
-go get github.com/go-sql-driver/mysql
-go get github.com/zenazn/goji
-go get github.com/zenazn/goji/web
-
-go run src/goji/server.go &
+go run src/goji/server.go &

+ 9 - 9
frameworks/Go/goji/src/goji/server.go

@@ -1,17 +1,17 @@
 package main
 
 import (
-	"fmt"
-	"net/http"
+	"database/sql"
 	"encoding/json"
 	"flag"
-	"runtime"
-	"database/sql"
+	"fmt"
+	"html/template"
 	"log"
 	"math/rand"
-	"strconv"
-	"html/template"
+	"net/http"
+	"runtime"
 	"sort"
+	"strconv"
 
 	_ "github.com/go-sql-driver/mysql"
 
@@ -28,7 +28,7 @@ const (
 	worldRowCount      = 10000
 	maxConnectionCount = 256
 
-	helloWorldString = "Hello, World!"
+	helloWorldString    = "Hello, World!"
 	extraFortuneMessage = "Additional fortune added at request time."
 )
 
@@ -36,7 +36,7 @@ var (
 	// Templates
 	tmpl = template.Must(template.
 		ParseFiles("templates/layout.html",
-			       "templates/fortune.html"))
+		"templates/fortune.html"))
 
 	// Database
 	worldStatement   *sql.Stmt
@@ -89,7 +89,7 @@ func setContentType(w http.ResponseWriter, contentType string) {
 // Test 1: Json Serialization
 func serializeJson(c web.C, w http.ResponseWriter, r *http.Request) {
 	setContentType(w, "application/json")
-    json.NewEncoder(w).Encode(&Message{helloWorldString})
+	json.NewEncoder(w).Encode(&Message{helloWorldString})
 }
 
 // Test 2: Single Database Query