Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove MarshalJSON on BidderName #3394

Merged
merged 1 commit into from
Jan 23, 2024

Conversation

linux019
Copy link
Contributor

@linux019 linux019 commented Jan 10, 2024

The receiver on BidderName returns incorrect string (it should be quoted)

return []byte(name), nil

As BidderName is just a redefinition of string, no need MarshalJSON on this type

func TestBidderName(t *testing.T) {
	_, err := json.Marshal(
		struct {
			Name openrtb_ext.BidderName
		}{Name: openrtb_ext.BidderMedianet})

	if err != nil {
		t.Log(err)
		t.Fail()
	}
}
=== RUN   TestBidderName
    main_test.go:78: json: error calling MarshalJSON for type openrtb_ext.BidderName: invalid character 'm' looking for beginning of value
--- FAIL: TestBidderName (0.00s)

FAIL

Copy link
Collaborator

@hhhjort hhhjort left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@bsardo bsardo merged commit ed5e887 into prebid:master Jan 23, 2024
3 checks passed
@linux019 linux019 deleted the fix-marshal-bidder-name branch January 29, 2024 21:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants