1
0
Fork 0
mirror of https://github.com/gocsaf/csaf.git synced 2025-12-22 11:55:40 +01:00

Update lint (#626)

* Update linter

* Format

* Fix lint
This commit is contained in:
Paul Schwabauer 2025-03-19 09:39:07 +01:00 committed by GitHub
parent 5709b14650
commit 0848143a0b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 16 additions and 19 deletions

View file

@ -224,12 +224,12 @@ func (f *forwarder) storeFailed(filename, doc, sha256, sha512 string) {
// limitedString reads max bytes from reader and returns it as a string.
// Longer strings are indicated by "..." as a suffix.
func limitedString(r io.Reader, max int) (string, error) {
func limitedString(r io.Reader, maxLength int) (string, error) {
var msg strings.Builder
if _, err := io.Copy(&msg, io.LimitReader(r, int64(max))); err != nil {
if _, err := io.Copy(&msg, io.LimitReader(r, int64(maxLength))); err != nil {
return "", err
}
if msg.Len() >= max {
if msg.Len() >= maxLength {
msg.WriteString("...")
}
return msg.String(), nil