You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: pid.go
    path of file: ./repos/franz-go/pkg/kfake
    
    the code of the file until where you have to start completion: package kfake

import (
	"hash/fnv"
	"math"
	"math/rand"
)

// TODO
//
// * Convert pids to struct, add heap of last use, add index to pi
    
func (seqs *pidseqs) pushAndValidate(firstSeq, numRecs int32) (ok, dup bool) {
	// If there is no pid, we do not do duplicate detection.
	if seqs == nil {
		return true, false
	}
	var (
		seq    = firstSeq
		seq64  = int64(seq)
		next64 = (seq64 + int64(numRecs)) % math.MaxInt32
		next   = int32(next64)
	)
	for i := 0; i < 5; i++ {
		if seqs.seqs[i] == seq && seqs.seqs[(i+1)%5] == next {
			return true, true
		}
	}
	if seqs.seqs[seqs.at] != seq {
		return false, false
	}
	seqs.at = (seqs.at + 1) % 5
	seqs.seqs[seqs.at] = next
	return true, false
}