chore: run go fix for Go 1.26 modernization
CI / Go vulnerabilities (push) Successful in 1m10s
CI / Build & Vet (push) Successful in 1m39s
CI / Frontend build (gate) (push) Successful in 1m42s
CI / Frontend QC (audit) (push) Successful in 56s
CI / Frontend QC (typecheck) (push) Successful in 1m36s
CI / Frontend QC (lint) (push) Successful in 1m51s
CI / Tests (prod) (push) Has been cancelled
CI / Tests (dev) (push) Has been cancelled
CI / Race (prod) (push) Has been cancelled
CI / Race (dev) (push) Has been cancelled
CI / Go vulnerabilities (push) Successful in 1m10s
CI / Build & Vet (push) Successful in 1m39s
CI / Frontend build (gate) (push) Successful in 1m42s
CI / Frontend QC (audit) (push) Successful in 56s
CI / Frontend QC (typecheck) (push) Successful in 1m36s
CI / Frontend QC (lint) (push) Successful in 1m51s
CI / Tests (prod) (push) Has been cancelled
CI / Tests (dev) (push) Has been cancelled
CI / Race (prod) (push) Has been cancelled
CI / Race (dev) (push) Has been cancelled
106 files: interface{}→any, strings.Split→SplitSeq, CutPrefix/Cut, strings.Builder, slices.Contains, remove redundant // +build directives, gofmt import ordering and indentation.
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)
Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
//go:build dev
|
||||
// +build dev
|
||||
|
||||
package dav
|
||||
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
//go:build !dev
|
||||
// +build !dev
|
||||
|
||||
package dav
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
package dav
|
||||
|
||||
import (
|
||||
"crussell/clock"
|
||||
"context"
|
||||
"crussell/clock"
|
||||
"fmt"
|
||||
"strings"
|
||||
"time"
|
||||
@@ -131,7 +131,7 @@ func (s *BaseService) ListRecentContacts(days int) ([]Contact, error) {
|
||||
// Helper Methods
|
||||
// ============================================================================
|
||||
|
||||
func (s *BaseService) queryEventsWithContacts(query string, args ...interface{}) ([]CalendarEvent, error) {
|
||||
func (s *BaseService) queryEventsWithContacts(query string, args ...any) ([]CalendarEvent, error) {
|
||||
rows, err := s.db.Query(context.Background(), query, args...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -155,7 +155,7 @@ func (s *BaseService) queryEventsWithContacts(query string, args ...interface{})
|
||||
|
||||
func extractContactURIsFromICalendar(icalData string) []string {
|
||||
var uris []string
|
||||
for _, line := range strings.Split(icalData, "\n") {
|
||||
for line := range strings.SplitSeq(icalData, "\n") {
|
||||
line = strings.TrimSpace(line)
|
||||
if strings.HasPrefix(line, "ATTENDEE") {
|
||||
parts := strings.Split(line, ":")
|
||||
|
||||
@@ -3,6 +3,7 @@ package dav
|
||||
import (
|
||||
"crussell/clock"
|
||||
"fmt"
|
||||
"strings"
|
||||
"time"
|
||||
)
|
||||
|
||||
@@ -102,9 +103,9 @@ func GenerateICalEvent(input EventInput) string {
|
||||
}
|
||||
|
||||
// Build attendees section
|
||||
attendees := ""
|
||||
var attendees strings.Builder
|
||||
for _, contactURI := range input.ContactURIs {
|
||||
attendees += fmt.Sprintf("ATTENDEE;CN=%s:%s\n", contactURI, contactURI)
|
||||
attendees.WriteString(fmt.Sprintf("ATTENDEE;CN=%s:%s\n", contactURI, contactURI))
|
||||
}
|
||||
|
||||
ical := fmt.Sprintf(`BEGIN:VCALENDAR
|
||||
@@ -127,7 +128,7 @@ END:VCALENDAR`, uid, dtstamp, dtstart, dtend,
|
||||
escapeICalText(input.Summary),
|
||||
escapeICalText(input.Description),
|
||||
escapeICalText(input.Location),
|
||||
attendees)
|
||||
attendees.String())
|
||||
|
||||
return ical
|
||||
}
|
||||
@@ -164,13 +165,13 @@ func escapeICalText(text string) string {
|
||||
}
|
||||
|
||||
func replaceAll(s, old, new string) string {
|
||||
result := ""
|
||||
var result strings.Builder
|
||||
for _, char := range s {
|
||||
if string(char) == old {
|
||||
result += new
|
||||
result.WriteString(new)
|
||||
} else {
|
||||
result += string(char)
|
||||
result.WriteString(string(char))
|
||||
}
|
||||
}
|
||||
return result
|
||||
return result.String()
|
||||
}
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
//go:build test
|
||||
// +build test
|
||||
|
||||
package images
|
||||
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
//go:build !dev
|
||||
// +build !dev
|
||||
|
||||
package s3
|
||||
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
//go:build dev
|
||||
// +build dev
|
||||
|
||||
package s3
|
||||
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
//go:build !dev
|
||||
// +build !dev
|
||||
|
||||
package square
|
||||
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
//go:build dev
|
||||
// +build dev
|
||||
|
||||
package square
|
||||
|
||||
import (
|
||||
"crussell/clock"
|
||||
"context"
|
||||
"crussell/clock"
|
||||
"fmt"
|
||||
"log"
|
||||
"os"
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
//go:build test && dev
|
||||
// +build test,dev
|
||||
|
||||
package square
|
||||
|
||||
|
||||
@@ -30,11 +30,11 @@ func ValidateEmail(email string) error {
|
||||
|
||||
// NormalizeGiftCardCode strips non-alphanumeric characters and upper-cases the code.
|
||||
func NormalizeGiftCardCode(code string) string {
|
||||
clean := ""
|
||||
var clean strings.Builder
|
||||
for _, char := range code {
|
||||
if (char >= 'a' && char <= 'z') || (char >= 'A' && char <= 'Z') || (char >= '0' && char <= '9') {
|
||||
clean += string(char)
|
||||
clean.WriteString(string(char))
|
||||
}
|
||||
}
|
||||
return clean
|
||||
return clean.String()
|
||||
}
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
//go:build test
|
||||
// +build test
|
||||
|
||||
package validators
|
||||
|
||||
|
||||
Reference in New Issue
Block a user