Skip to content

Commit 52f9fff

Browse files
authored
fix: Correct body in EnterpriseService.InitialConfig (#3763)
1 parent 22f34ec commit 52f9fff

File tree

3 files changed

+8
-7
lines changed

3 files changed

+8
-7
lines changed

.golangci.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ linters:
1717
- gosec
1818
- intrange
1919
- misspell
20+
- musttag
2021
- nakedret
2122
- paralleltest
2223
- perfsprint

github/enterprise_manage_ghes_config.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -63,10 +63,10 @@ type ConfigApplyEventsNodeEvent struct {
6363
SpanDepth *int `json:"span_depth,omitempty"`
6464
}
6565

66-
// InitialConfigOptions is a struct to hold the options for the InitialConfig API.
66+
// InitialConfigOptions represents the payload for initializing instance configuration.
6767
type InitialConfigOptions struct {
68-
License string `url:"license"`
69-
Password string `url:"password"`
68+
License string `json:"license"`
69+
Password string `json:"password"`
7070
}
7171

7272
// LicenseStatus is a struct to hold the response from the License API.
@@ -336,12 +336,12 @@ func (s *EnterpriseService) ConfigApplyEvents(ctx context.Context, opts *ConfigA
336336
func (s *EnterpriseService) InitialConfig(ctx context.Context, license, password string) (*Response, error) {
337337
u := "manage/v1/config/init"
338338

339-
opts := &InitialConfigOptions{
339+
payload := &InitialConfigOptions{
340340
License: license,
341341
Password: password,
342342
}
343343

344-
req, err := s.client.NewRequest("POST", u, opts)
344+
req, err := s.client.NewRequest("POST", u, payload)
345345
if err != nil {
346346
return nil, err
347347
}

github/timestamp_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,8 @@ func TestTimestamp_MarshalReflexivity(t *testing.T) {
111111
}
112112

113113
type WrappedTimestamp struct {
114-
A int
115-
Time Timestamp
114+
A int `json:"A"`
115+
Time Timestamp `json:"Time"`
116116
}
117117

118118
func TestWrappedTimestamp_Marshal(t *testing.T) {

0 commit comments

Comments
 (0)