Files
SpotiFLAC-Mobile/go_backend/json_util.go
T
zarzet 8c2d2d5289 refactor(backend): dedupe response builders and MusicBrainz fetch
marshalJSONString collapses 62 identical marshal-and-return blocks in the
gomobile exports; jsError/jsSuccess collapse 135 goja extension-response
maps; the two MusicBrainz fetchers share one request+retry helper; the
extension-HTTP default User-Agent block and fileExists get single homes.
No exported signature changes.
2026-07-11 16:34:36 +07:00

14 lines
300 B
Go

package gobackend
import "encoding/json"
// marshalJSONString marshals v and returns it as a string, the shape every
// gomobile export returns.
func marshalJSONString(v any) (string, error) {
jsonBytes, err := json.Marshal(v)
if err != nil {
return "", err
}
return string(jsonBytes), nil
}