From a3b7072672bbd74ffce4c654453cbeaede73d922 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E8=8C=B6=E6=B8=85=E6=AC=A2?= Date: Tue, 28 Mar 2023 18:39:05 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0JSON=E5=85=B3=E9=94=AE?= =?UTF-8?q?=E8=AF=8D=E5=AE=9A=E4=B9=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tree/consts.go | 25 +++++++++++++++++++++++++ tree/node.go | 2 +- 2 files changed, 26 insertions(+), 1 deletion(-) create mode 100644 tree/consts.go diff --git a/tree/consts.go b/tree/consts.go new file mode 100644 index 0000000..1e03547 --- /dev/null +++ b/tree/consts.go @@ -0,0 +1,25 @@ +// Package tree ... +// +// Description : tree ... +// +// Author : go_developer@163.com<白茶清欢> +// +// Date : 2023-03-28 18:32 +package tree + +const ( + // KeywordObjectStart 对象开始标识 + KeywordObjectStart = "{" + // KeywordObjectEnd 对象结束标识 + KeywordObjectEnd = "}" + // KeywordArrayStart 数组开始标识 + KeywordArrayStart = "[" + // KeywordArrayEnd 数组结束标识 + KeywordArrayEnd = "]" + // KeywordColon 冒号 + KeywordColon = ":" + // KeywordDoubleQuote 双引号 + KeywordDoubleQuote = `"` + // KeywordEscapeSymbol 转义符号 + KeywordEscapeSymbol = `\` +) diff --git a/tree/node.go b/tree/node.go index a332125..bf8cfdb 100644 --- a/tree/node.go +++ b/tree/node.go @@ -15,7 +15,7 @@ package tree type Node struct { IsVirtual bool // 是否虚拟节点, 主要应对输入的原始数据为list这一场景 Value interface{} // 节点的值 - ValueType string // 数据类型 int64 / float64 / map / list / nil + ValueType string // 数据类型 string / int64 / float64 / map / list / nil Key string // 节点的key名称(输入的原始名称) Show bool // 节点是否可见 ShowKey string // 重新序列化后, 对外输出的Key