fixed linting errors

This commit is contained in:
2024-03-20 12:46:59 +01:00
parent fbfeccfd08
commit 972bb003d5

View File

@@ -20,16 +20,12 @@ package main
import ( import (
"fmt" "fmt"
"log/slog" "log/slog"
"math/rand"
"time"
fn "github.com/s0rg/fantasyname" fn "github.com/s0rg/fantasyname"
) )
// Actual fantasy name generation // Actual fantasy name generation
func Generate(conf *Config) ([]string, error) { func Generate(conf *Config) ([]string, error) {
rand.Seed(time.Now().UnixNano())
// we register each generated word to avoid duplicates, which // we register each generated word to avoid duplicates, which
// naturally happens every while // naturally happens every while
reg := map[string]int{} reg := map[string]int{}
@@ -73,7 +69,7 @@ func Generate(conf *Config) ([]string, error) {
names := make([]string, len(reg)) names := make([]string, len(reg))
i := 0 i := 0
for k, _ := range reg { for k := range reg {
names[i] = k names[i] = k
i++ i++
} }