1
0
Fork 0
mirror of https://github.com/alice-lg/birdwatcher.git synced 2025-03-09 00:00:05 +01:00

Call pattern() with the name of the start tag instead.

This commit is contained in:
Michael Cardell Widerkrantz 2016-10-23 17:23:57 +02:00
parent 87f8123138
commit 2335670d97

View file

@ -2,8 +2,10 @@ package main
import (
"encoding/json"
"github.com/julienschmidt/httprouter"
"fmt"
"net/http"
"github.com/julienschmidt/httprouter"
)
func Protocols(w http.ResponseWriter, r *http.Request, ps httprouter.Params) {
@ -13,10 +15,13 @@ func Protocols(w http.ResponseWriter, r *http.Request, ps httprouter.Params) {
lines, err := readLines(conf.Conf.FileName)
if err != nil {
slog.Err("Couldn't find file: " + conf.Conf.FileName)
return
}
pattern(conf.Res["getprotocol"], lines)
res["data"] = pattern("getprotocol", lines)
fmt.Printf(">>>>>>>>>>>>>>>> data: %v\n", res["data"])
js, _ := json.Marshal(res)