mirror of
https://github.com/prebid/openrtb.git
synced 2026-06-14 22:16:41 +03:00
3855899d4b
https://blog.golang.org/v2-go-modules Roughly, just a: ```shell find -type f -iname '*.go' | xargs -I {} sed -i 's/mxmCherry\/openrtb/mxmCherry\/openrtb\/v14/g' {} find -type f -iname '*.go' | xargs -I {} goimports -w {} ``` Also, point to pkg.go.dev for documentation (old godoc.org badge kept kill pkg.go.dev provides its own).
32 lines
750 B
Go
32 lines
750 B
Go
package adcom1_test
|
|
|
|
import (
|
|
"encoding/json"
|
|
"io/ioutil"
|
|
"path/filepath"
|
|
|
|
. "github.com/onsi/ginkgo/extensions/table"
|
|
. "github.com/onsi/gomega"
|
|
|
|
. "github.com/mxmCherry/openrtb/v14/adcom1"
|
|
)
|
|
|
|
var _ = DescribeTable(
|
|
"Marshaling",
|
|
func(obj interface{}, file string) {
|
|
golden, err := ioutil.ReadFile(filepath.Join("testdata", file))
|
|
Expect(err).NotTo(HaveOccurred())
|
|
|
|
Expect(json.Unmarshal(golden, obj)).To(Succeed())
|
|
|
|
b, err := json.Marshal(obj)
|
|
Expect(err).NotTo(HaveOccurred())
|
|
|
|
Expect(b).To(MatchJSON(golden))
|
|
},
|
|
|
|
Entry("request context", new(RequestContext), "request-context.json"),
|
|
Entry("item specifications", new(ItemSpec), "item-specifications.json"),
|
|
Entry("media response", new(BidMedia), "media-response.json"),
|
|
)
|