Local tl parser

This commit is contained in:
c0re100 2022-01-27 05:05:22 +08:00
parent 7a29e8eead
commit 611fb8a865
No known key found for this signature in database
GPG key ID: 7C3B3004FE745AAF

View file

@ -4,7 +4,6 @@ import (
"bufio"
"flag"
"log"
"net/http"
"os"
"path/filepath"
@ -33,14 +32,13 @@ func main() {
flag.Parse()
resp, err := http.Get("https://raw.githubusercontent.com/tdlib/td/" + config.version + "/td/generate/scheme/td_api.tl")
tl, err := os.Open("./data/td_api.tl")
if err != nil {
log.Fatalf("http.Get error: %s", err)
log.Fatalf(err.Error())
return
}
defer resp.Body.Close()
schema, err := tlparser.Parse(resp.Body)
schema, err := tlparser.Parse(bufio.NewReader(tl))
if err != nil {
log.Fatalf("schema parse error: %s", err)
return