Created
February 8, 2015 20:10
-
-
Save kanuku/34458e4d44f164cec00d to your computer and use it in GitHub Desktop.
./main.go:22: INDEX_HTML declared and not used
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"io/ioutil" | |
"net/http" | |
) | |
var INDEX_HTML []byte | |
func main() { | |
fmt.Println("starting server on http://localhost:8080/") | |
http.HandleFunc("/", IndexHandler) | |
http.ListenAndServe(":8080", nil) | |
} | |
func IndexHandler(w http.ResponseWriter, r *http.Request) { | |
w.Write([]byte(INDEX_HTML)) | |
} | |
func init() { | |
INDEX_HTML, _ := ioutil.ReadFile("./tmpl/index.html") | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment