Update dependencies and build to go1.22 (#2113)

* Update dependencies and build to go1.22

* Fix api changes wrt to dependencies

* Update golangci config
This commit is contained in:
Wim
2024-05-23 23:44:31 +02:00
committed by GitHub
parent 56e7bd01ca
commit 2f33fe86f5
1556 changed files with 3279522 additions and 1924375 deletions

View File

@@ -147,6 +147,16 @@ func (s TextBlockObject) Validate() error {
return errors.New("emoji cannot be true in mrkdown")
}
// https://api.slack.com/reference/block-kit/composition-objects#text__fields
if len(s.Text) == 0 {
return errors.New("text must have a minimum length of 1")
}
// https://api.slack.com/reference/block-kit/composition-objects#text__fields
if len(s.Text) > 3000 {
return errors.New("text cannot be longer than 3000 characters")
}
return nil
}
@@ -177,7 +187,7 @@ type ConfirmationBlockObject struct {
Title *TextBlockObject `json:"title"`
Text *TextBlockObject `json:"text"`
Confirm *TextBlockObject `json:"confirm"`
Deny *TextBlockObject `json:"deny"`
Deny *TextBlockObject `json:"deny,omitempty"`
Style Style `json:"style,omitempty"`
}