Converting to objects

This commit is contained in:
scratch
2019-10-19 05:00:05 +00:00
parent 3132ce1a1d
commit a8ee907a0f
6 changed files with 82 additions and 80 deletions

View File

@@ -5,6 +5,7 @@ import (
"fmt"
"io/ioutil"
"local/args"
"log"
"os"
"strings"
)
@@ -33,7 +34,8 @@ func Refresh() {
panic(err)
}
wrap := as.Get("wrap").String()
wrap := as.Get("wrap").GetString()
log.Printf("reading %v (%T)", wrap, wrap)
b, err := ioutil.ReadFile(wrap)
if err != nil {
panic(err)
@@ -43,8 +45,8 @@ func Refresh() {
panic(len(bs))
}
Root = as.Get("root").String()
Port = ":" + strings.TrimPrefix(as.Get("port").String(), ":")
Root = as.Get("root").GetString()
Port = ":" + strings.TrimPrefix(as.Get("port").GetString(), ":")
Head = string(bs[0])
Foot = string(bs[1])
}