mirror of
https://github.com/stashapp/stash.git
synced 2025-12-18 21:04:37 +03:00
Upgrade to go 1.19 and update dependencies (#3069)
* Update to go 1.19 * Update dependencies * Update cross-compile script * Add missing targets to cross-compile-all * Update cache action to remove warning
This commit is contained in:
35
vendor/github.com/asticode/go-astikit/json.go
generated
vendored
Normal file
35
vendor/github.com/asticode/go-astikit/json.go
generated
vendored
Normal file
@@ -0,0 +1,35 @@
|
||||
package astikit
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
)
|
||||
|
||||
func JSONEqual(a, b interface{}) bool {
|
||||
ba, err := json.Marshal(a)
|
||||
if err != nil {
|
||||
return false
|
||||
}
|
||||
bb, err := json.Marshal(b)
|
||||
if err != nil {
|
||||
return false
|
||||
}
|
||||
return bytes.Equal(ba, bb)
|
||||
}
|
||||
|
||||
func JSONClone(src, dst interface{}) (err error) {
|
||||
// Marshal
|
||||
var b []byte
|
||||
if b, err = json.Marshal(src); err != nil {
|
||||
err = fmt.Errorf("main: marshaling failed: %w", err)
|
||||
return
|
||||
}
|
||||
|
||||
// Unmarshal
|
||||
if err = json.Unmarshal(b, dst); err != nil {
|
||||
err = fmt.Errorf("main: unmarshaling failed: %w", err)
|
||||
return
|
||||
}
|
||||
return
|
||||
}
|
||||
Reference in New Issue
Block a user