18 lines
276 B
Go
18 lines
276 B
Go
package lambda
|
|
|
|
import (
|
|
"strconv"
|
|
|
|
"git.maximhutz.com/max/lambda/pkg/set"
|
|
)
|
|
|
|
func GenerateFreshName(used *set.Set[string]) string {
|
|
for i := uint64(0); ; i++ {
|
|
attempt := "_" + string(strconv.AppendUint(nil, i, 10))
|
|
|
|
if !used.Has(attempt) {
|
|
return attempt
|
|
}
|
|
}
|
|
}
|