underscore -> go spellings

This commit is contained in:
Stephen McQuay 2015-05-25 16:56:20 -07:00
parent 5f4b24ba35
commit b7bd99e465
3 changed files with 5 additions and 5 deletions

View File

@ -5,4 +5,4 @@ import (
)
var addr = flag.String("addr", ":8000", "http service address")
var db_file = flag.String("db", "db.json", "output database")
var dbFile = flag.String("db", "db.json", "output database")

View File

@ -18,7 +18,7 @@ func passHandler(resp http.ResponseWriter, req *http.Request) {
if err != nil {
log.Fatal(err)
}
err = ioutil.WriteFile(*db_file, b, 0644)
err = ioutil.WriteFile(*dbFile, b, 0644)
if err != nil {
log.Fatal(err)
}

View File

@ -22,8 +22,8 @@ var creds = make([]Cred, 0)
var m = sync.Mutex{}
var templates *template.Template
func init_db() {
b, err := ioutil.ReadFile(*db_file)
func initDb() {
b, err := ioutil.ReadFile(*dbFile)
if err != nil {
log.Println("Problem opening db file ... ignoring ...", err)
}
@ -36,7 +36,7 @@ func init_db() {
func main() {
flag.Parse()
init_db()
initDb()
http.HandleFunc("/pass", passHandler)
http.HandleFunc("/api/1.0/creds/", credHandler)