diff options
| author | Christian Cleberg <[email protected]> | 2026-07-14 19:09:21 -0500 |
|---|---|---|
| committer | Christian Cleberg <[email protected]> | 2026-07-14 19:09:21 -0500 |
| commit | edfc25e18c4585b2deed7b7d9531cc3fcecf1d4f (patch) | |
| tree | 39a31300036b79804d96d8920083b3ffb160b885 /deviantion.go | |
| parent | eea656e612d1a31b461fe73f2e26dfe526acfb83 (diff) | |
| download | devianter-edfc25e18c4585b2deed7b7d9531cc3fcecf1d4f.tar.gz devianter-edfc25e18c4585b2deed7b7d9531cc3fcecf1d4f.tar.bz2 devianter-edfc25e18c4585b2deed7b7d9531cc3fcecf1d4f.zip | |
fix: resolve golandci-lint errors
Diffstat (limited to 'deviantion.go')
| -rw-r--r-- | deviantion.go | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/deviantion.go b/deviantion.go index 288b0e2..197f2af 100644 --- a/deviantion.go +++ b/deviantion.go @@ -149,12 +149,15 @@ func GetDeviation(id string, user string) (st Post, err Error) { } } - json.Unmarshal([]byte(txt), &description) - for _, a := range description.Blocks { - txt = a.Text - } - } + if err := json.Unmarshal([]byte(txt), &description); err != nil { + // Handle error appropriately + try(err) // or log/return the error + } + for _, a := range description.Blocks { + txt = a.Text + } + } st.Description = txt - + return } |
