Skip to content

Commit

Permalink
add comment
Browse files Browse the repository at this point in the history
  • Loading branch information
swxctx committed Dec 21, 2018
1 parent 2333452 commit 5616f70
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
3 changes: 2 additions & 1 deletion format.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"unicode"
)

// keyFilter
func (xj *xjson) keyFilter(str string) (string, string) {
temp := xj.keyCase(str)
if _, ok := xj.MapTag[temp]; !ok {
Expand All @@ -18,7 +19,7 @@ func (xj *xjson) keyFilter(str string) (string, string) {

}

//change name to different case
// change name to different case
func (xj *xjson) keyCase(str string) string {
temp := strings.FieldsFunc(str, xj.XJSplit)
var (
Expand Down
5 changes: 2 additions & 3 deletions out.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,19 @@ func (xj *xjson) appendStr(kv string) {
xj.Out = append(xj.Out, kv)
}

//output
// printStruct
func (xj *xjson) printStruct() {
for _, value := range xj.Sub {
for i := 0; i < len(value); i++ {
fmt.Println(value[i])
}
}

for i := 0; i < len(xj.Out); i++ {
fmt.Println(xj.Out[i])
}
}

//write struct to file
// write struct to file
func (xj *xjson) writefileStruct(fileName string) {
file, err := os.OpenFile(fileName, os.O_WRONLY|os.O_APPEND|os.O_CREATE, 0666)
file.WriteString(goBegin)
Expand Down
1 change: 0 additions & 1 deletion sub.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ func (xj *xjson) subList(key string, out interface{}) {
xj.subList(key, vl)
continue
}

if vtype == Xmap {
m := vl.(map[string]interface{})
for k, v := range m {
Expand Down

0 comments on commit 5616f70

Please sign in to comment.