Skip to content

Commit

Permalink
Use ptrutil in jsonutil too.
Browse files Browse the repository at this point in the history
  • Loading branch information
scr-oath committed Dec 2, 2024
1 parent 5c8d751 commit 61c786d
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions util/jsonutil/forcestring.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
package jsonutil

import "github.com/tidwall/gjson"
import (
"github.com/prebid/prebid-server/v3/util/ptrutil"
"github.com/tidwall/gjson"
)

// ParseIntoString Parse json bytes into a string pointer
func ParseIntoString(b []byte, ppString **string) {
Expand All @@ -9,7 +12,6 @@ func ParseIntoString(b []byte, ppString **string) {
}
result := gjson.ParseBytes(b)
if result.Exists() && result.Raw != `null` {
*ppString = new(string)
**ppString = result.String()
*ppString = ptrutil.ToPtr(result.String())
}
}

0 comments on commit 61c786d

Please sign in to comment.