Skip to content

Commit 0a07c82

Browse files
committed
address comments
1 parent 8f7b316 commit 0a07c82

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

internal/oauthex/auth_meta.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -202,8 +202,8 @@ type ClientRegistrationResponse struct {
202202
ClientSecretExpiresAt time.Time `json:"client_secret_expires_at,omitempty"`
203203
}
204204

205-
func (r ClientRegistrationResponse) MarshalJSON() ([]byte, error) {
206-
type Alias ClientRegistrationResponse
205+
func (r *ClientRegistrationResponse) MarshalJSON() ([]byte, error) {
206+
type alias ClientRegistrationResponse
207207
var clientIDIssuedAt int64
208208
var clientSecretExpiresAt int64
209209

@@ -217,22 +217,22 @@ func (r ClientRegistrationResponse) MarshalJSON() ([]byte, error) {
217217
return json.Marshal(&struct {
218218
ClientIDIssuedAt int64 `json:"client_id_issued_at,omitempty"`
219219
ClientSecretExpiresAt int64 `json:"client_secret_expires_at,omitempty"`
220-
*Alias
220+
*alias
221221
}{
222222
ClientIDIssuedAt: clientIDIssuedAt,
223223
ClientSecretExpiresAt: clientSecretExpiresAt,
224-
Alias: (*Alias)(&r),
224+
alias: (*alias)(r),
225225
})
226226
}
227227

228228
func (r *ClientRegistrationResponse) UnmarshalJSON(data []byte) error {
229-
type Alias ClientRegistrationResponse
229+
type alias ClientRegistrationResponse
230230
aux := &struct {
231231
ClientIDIssuedAt int64 `json:"client_id_issued_at,omitempty"`
232232
ClientSecretExpiresAt int64 `json:"client_secret_expires_at,omitempty"`
233-
*Alias
233+
*alias
234234
}{
235-
Alias: (*Alias)(r),
235+
alias: (*alias)(r),
236236
}
237237
if err := json.Unmarshal(data, &aux); err != nil {
238238
return err

internal/oauthex/auth_meta_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ func TestClientRegistrationResponseJSON(t *testing.T) {
197197
t.Run(tc.name, func(t *testing.T) {
198198
// Test MarshalJSON
199199
t.Run("marshal", func(t *testing.T) {
200-
b, err := json.Marshal(tc.in)
200+
b, err := json.Marshal(&tc.in)
201201
if err != nil {
202202
t.Fatalf("Marshal() error = %v", err)
203203
}

0 commit comments

Comments
 (0)