Skip to content

Commit

Permalink
Обход вложенных полей - 2
Browse files Browse the repository at this point in the history
  • Loading branch information
Boris committed Nov 2, 2024
1 parent 9851023 commit 12859f2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
7 changes: 4 additions & 3 deletions modules/router/router.go
Original file line number Diff line number Diff line change
Expand Up @@ -845,9 +845,9 @@ func (rt *Router) ApiHandler(w http.ResponseWriter, r *http.Request) {
s := reflect.ValueOf(data)
var ss string
for i := 0; i < s.Len(); i++ {
ss = ss + fmt.Sprintf("%v,", s.Index(i))
ss = ss + fmt.Sprintf("%v, ", s.Index(i))
}
ss = strings.TrimSuffix(ss, ",")
ss = strings.TrimSuffix(ss, ", ")
ss = strings.Replace(ss, "\n", "", -1)
ss = strings.Replace(ss, "\"", "\"\"", -1)
f.WriteString(fmt.Sprintf(`"%s";`, ss))
Expand Down Expand Up @@ -917,8 +917,9 @@ func (rt *Router) ApiHandler(w http.ResponseWriter, r *http.Request) {
s := reflect.ValueOf(data)
var ss string
for i := 0; i < s.Len(); i++ {
ss = ss + fmt.Sprintf(" %v,", s.Index(i))
ss = ss + fmt.Sprintf("%v, ", s.Index(i))
}
ss = strings.TrimSuffix(ss, ", ")
ss = strings.Replace(ss, "\n", "", -1)
ss = strings.Replace(ss, "\"", "\"\"", -1)
f.WriteString(fmt.Sprintf(`"%s";`, ss))
Expand Down
2 changes: 1 addition & 1 deletion modules/version/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@

package version

var Version = "extractor/v0.2.10"
var Version = "extractor/v0.2.11"

0 comments on commit 12859f2

Please sign in to comment.