-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.go
More file actions
32 lines (28 loc) · 830 Bytes
/
main.go
File metadata and controls
32 lines (28 loc) · 830 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
package main
import (
"fmt"
_ "github.com/robertkrimen/otto/underscore"
"github.com/GrayOxygen/json-go-struct/util"
"github.com/GrayOxygen/json-go-struct/apis"
"io/ioutil"
"os"
"runtime"
)
func main() {
//读取json文件 START
fmt.Println(util.GetCurPath())
bytes, err := ioutil.ReadFile("./testjson/test3.json")
jsonStr := string(bytes)
////读取json文件 END
util.Log.Printf("\n 传入的json为 %s \n", jsonStr)
nestStructStr, structStr, err := apis.JSON2Struct(jsonStr);
fmt.Println("Start............===============")
fmt.Println(nestStructStr)
fmt.Println("===============")
fmt.Println(structStr)
fmt.Println("===============")
if err != nil {
fmt.Println(err)
}
util.Log.Printf("测试 v%s pid=%d started with processes: %d", "1.0.0", os.Getpid(), runtime.GOMAXPROCS(runtime.NumCPU()))
}