fix formatting

This commit is contained in:
tarat44 2021-10-04 22:12:26 -04:00
parent f8b47cdfcd
commit e46b41d04d
3 changed files with 14 additions and 14 deletions

View File

@ -861,12 +861,12 @@ func TestAgent_AddServiceWithH2CPINGCheck(t *testing.T) {
defer a.Shutdown() defer a.Shutdown()
check := []*structs.CheckType{ check := []*structs.CheckType{
{ {
CheckID: "test-h2cping-check", CheckID: "test-h2cping-check",
Name: "test-h2cping-check", Name: "test-h2cping-check",
H2PING: "localhost:12345", H2PING: "localhost:12345",
TLSSkipVerify: true, TLSSkipVerify: true,
Interval: 10 * time.Second, Interval: 10 * time.Second,
H2PingUseTLS: false, H2PingUseTLS: false,
}, },
} }

View File

@ -77,8 +77,8 @@ func (t *CheckDefinition) UnmarshalJSON(data []byte) (err error) {
Alias: (*Alias)(t), Alias: (*Alias)(t),
} }
aux.H2PingUseTLS = true aux.H2PingUseTLS = true
aux.H2PingUseTLSSnake = true aux.H2PingUseTLSSnake = true
if err = lib.UnmarshalJSON(data, &aux); err != nil { if err = lib.UnmarshalJSON(data, &aux); err != nil {
return err return err
} }
@ -108,9 +108,9 @@ func (t *CheckDefinition) UnmarshalJSON(data []byte) (err error) {
if t.ServiceID == "" { if t.ServiceID == "" {
t.ServiceID = aux.ServiceIDSnake t.ServiceID = aux.ServiceIDSnake
} }
if !aux.H2PingUseTLSSnake { if !aux.H2PingUseTLSSnake {
t.H2PingUseTLS = aux.H2PingUseTLSSnake t.H2PingUseTLS = aux.H2PingUseTLSSnake
} }
// Parse special values // Parse special values
if aux.Interval != nil { if aux.Interval != nil {

View File

@ -159,9 +159,9 @@ func (t *CheckType) UnmarshalJSON(data []byte) (err error) {
t.DeregisterCriticalServiceAfter = time.Duration(v) t.DeregisterCriticalServiceAfter = time.Duration(v)
} }
} }
if !aux.H2PingUseTLSSnake { if !aux.H2PingUseTLSSnake {
t.H2PingUseTLS = aux.H2PingUseTLSSnake t.H2PingUseTLS = aux.H2PingUseTLSSnake
} }
return nil return nil