Skip to content

Commit

Permalink
address lint complaints, again
Browse files Browse the repository at this point in the history
Signed-off-by: Tim Bray <tbray@textuality.com>
  • Loading branch information
timbray committed Sep 9, 2024
1 parent c9c0223 commit e95536c
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions prettyprinter.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,18 +38,18 @@ var sharedNullPrinter = &nullPrinter{}
type prettyPrinter struct {
randInts rand.Source
tableLabels map[*smallTable]string
tableSerials map[*smallTable]uint64
tableSerials map[*smallTable]uint
}

func newPrettyPrinter(seed int) *prettyPrinter {
return &prettyPrinter{
randInts: rand.NewSource(int64(seed)),
tableLabels: make(map[*smallTable]string),
tableSerials: make(map[*smallTable]uint64),
tableSerials: make(map[*smallTable]uint),
}
}

func (pp *prettyPrinter) tableSerial(t *smallTable) uint64 {
func (pp *prettyPrinter) tableSerial(t *smallTable) uint {
return pp.tableSerials[t]
}
func (pp *prettyPrinter) tableLabel(t *smallTable) string {
Expand All @@ -58,7 +58,9 @@ func (pp *prettyPrinter) tableLabel(t *smallTable) string {

func (pp *prettyPrinter) labelTable(table *smallTable, label string) {
pp.tableLabels[table] = label
pp.tableSerials[table] = uint64(pp.randInts.Int63()%500 + 500)
newSerial := pp.randInts.Int63()%500 + 500
//nolint:gosec
pp.tableSerials[table] = uint(newSerial)
}

func (pp *prettyPrinter) printNFA(t *smallTable) string {
Expand Down

0 comments on commit e95536c

Please sign in to comment.