MCPcopy
hub / github.com/davyxu/tabtoy / LoadSpecifiedTable

Function LoadSpecifiedTable

v3/example/protobuf/golang/main.go:31–53  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

29}
30
31func LoadSpecifiedTable() {
32 var tabData Table
33 loadTableFromFile(&tabData, "../ExampleData.pbb")
34
35 fmt.Println("load specified table: ExampleData")
36 for k, v := range tabData.ExampleData {
37 fmt.Println(k, v)
38 }
39
40 var tabKV Table
41 loadTableFromFile(&tabKV, "../ExampleKV.pbb")
42
43 fmt.Println("load specified table: ExampleKV")
44 for k, v := range tabKV.ExampleKV {
45 fmt.Println(k, v)
46 }
47
48 // 将表格合并
49 var total Table
50 proto.Merge(&total, &tabData)
51 proto.Merge(&total, &tabKV)
52 fmt.Printf("merged table, data len: %d, kv len: %d\n", len(total.ExampleData), len(total.ExampleKV))
53}
54
55func main() {
56

Callers 1

mainFunction · 0.70

Calls 2

loadTableFromFileFunction · 0.85
PrintfMethod · 0.80

Tested by

no test coverage detected