Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions grpc/interceptors.go
Original file line number Diff line number Diff line change
Expand Up @@ -199,8 +199,9 @@ func (smi *serverMetadataInterceptor) Stream(
// a `UnaryClientInterceptor`.
func splitMethodName(fullMethodName string) (string, string) {
fullMethodName = strings.TrimPrefix(fullMethodName, "/") // remove leading slash
if i := strings.Index(fullMethodName, "/"); i >= 0 {
return fullMethodName[:i], fullMethodName[i+1:]
before, after, ok := strings.Cut(fullMethodName, "/")
if ok {
return before, after
}
return "unknown", "unknown"
}
Expand Down
2 changes: 0 additions & 2 deletions policy/pa_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -506,7 +506,6 @@ func TestChallengeTypesFor(t *testing.T) {
}

for _, tc := range testCases {
tc := tc // Capture range variable
t.Run(tc.name, func(t *testing.T) {
t.Parallel()
challs, err := pa.ChallengeTypesFor(tc.ident)
Expand Down Expand Up @@ -562,7 +561,6 @@ func TestChallengeTypesFor(t *testing.T) {
}

for _, tc := range testCases {
tc := tc // Capture range variable
t.Run(tc.name, func(t *testing.T) {
t.Parallel()
challs, err := pa.ChallengeTypesFor(tc.ident)
Expand Down
11 changes: 6 additions & 5 deletions sa/sa_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3843,22 +3843,23 @@ func bulkInsertPausedIdentifiers(ctx context.Context, sa *SQLStorageAuthority, r
batches := (count + batchSize - 1) / batchSize

for batch := range batches {
query := `
var query strings.Builder
query.WriteString(`
INSERT INTO paused (registrationID, identifierType, identifierValue, pausedAt)
VALUES`
VALUES`)

start := batch * batchSize
end := min(start+batchSize, count)

for i := start; i < end; i++ {
if i > start {
query += ","
query.WriteString(",")
}
query += "(?, ?, ?, ?)"
query.WriteString("(?, ?, ?, ?)")
values = append(values, regID, identifierTypeToUint[string(identifier.TypeDNS)], fmt.Sprintf("example%d.com", i), now)
}

_, err := sa.dbMap.ExecContext(ctx, query, values...)
_, err := sa.dbMap.ExecContext(ctx, query.String(), values...)
if err != nil {
return fmt.Errorf("bulk inserting paused identifiers: %w", err)
}
Expand Down
2 changes: 1 addition & 1 deletion test/list-features/list-features.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
)

func main() {
for _, flag := range reflect.VisibleFields(reflect.TypeOf(features.Config{})) {
for _, flag := range reflect.VisibleFields(reflect.TypeFor[features.Config]()) {
fmt.Println(flag.Name)
}
}