underscore -> go spellings
This commit is contained in:
parent
5f4b24ba35
commit
b7bd99e465
2
flags.go
2
flags.go
@ -5,4 +5,4 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
var addr = flag.String("addr", ":8000", "http service address")
|
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")
|
||||||
|
@ -18,7 +18,7 @@ func passHandler(resp http.ResponseWriter, req *http.Request) {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatal(err)
|
log.Fatal(err)
|
||||||
}
|
}
|
||||||
err = ioutil.WriteFile(*db_file, b, 0644)
|
err = ioutil.WriteFile(*dbFile, b, 0644)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatal(err)
|
log.Fatal(err)
|
||||||
}
|
}
|
||||||
|
6
main.go
6
main.go
@ -22,8 +22,8 @@ var creds = make([]Cred, 0)
|
|||||||
var m = sync.Mutex{}
|
var m = sync.Mutex{}
|
||||||
var templates *template.Template
|
var templates *template.Template
|
||||||
|
|
||||||
func init_db() {
|
func initDb() {
|
||||||
b, err := ioutil.ReadFile(*db_file)
|
b, err := ioutil.ReadFile(*dbFile)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Println("Problem opening db file ... ignoring ...", err)
|
log.Println("Problem opening db file ... ignoring ...", err)
|
||||||
}
|
}
|
||||||
@ -36,7 +36,7 @@ func init_db() {
|
|||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
flag.Parse()
|
flag.Parse()
|
||||||
init_db()
|
initDb()
|
||||||
|
|
||||||
http.HandleFunc("/pass", passHandler)
|
http.HandleFunc("/pass", passHandler)
|
||||||
http.HandleFunc("/api/1.0/creds/", credHandler)
|
http.HandleFunc("/api/1.0/creds/", credHandler)
|
||||||
|
Loading…
Reference in New Issue
Block a user