[create-pull-request] automated change (#90)

Co-authored-by: joshuaspence <joshuaspence@users.noreply.github.com>
This commit is contained in:
github-actions[bot]
2022-08-10 11:06:46 +10:00
committed by GitHub
parent adcc9a2556
commit 8f0bac78f6
8 changed files with 277 additions and 184 deletions

View File

@@ -27,15 +27,13 @@ type SettingAutoSpeedtest struct {
Key string `json:"key"`
Enabled bool `json:"enabled"`
Interval int `json:"interval,omitempty"` // ^(1[2-9]|[2-9][0-9]|[1-9][0-9]{2,3})$
CronExpr string `json:"cron_expr,omitempty"`
Enabled bool `json:"enabled"`
}
func (dst *SettingAutoSpeedtest) UnmarshalJSON(b []byte) error {
type Alias SettingAutoSpeedtest
aux := &struct {
Interval emptyStringInt `json:"interval"`
*Alias
}{
Alias: (*Alias)(dst),
@@ -45,7 +43,6 @@ func (dst *SettingAutoSpeedtest) UnmarshalJSON(b []byte) error {
if err != nil {
return fmt.Errorf("unable to unmarshal alias: %w", err)
}
dst.Interval = int(aux.Interval)
return nil
}