From 8febdb8df8a8bb69a8a9855496d404312cf89c48 Mon Sep 17 00:00:00 2001 From: Matias Insaurralde Date: Wed, 15 Nov 2023 15:00:41 +0000 Subject: [PATCH] Update random to use new rand approach --- random/random.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/random/random.go b/random/random.go index 7b933a9bd..dae13266a 100644 --- a/random/random.go +++ b/random/random.go @@ -19,7 +19,7 @@ func ProteinSequence(length int, seed int64) (string, error) { // https://en.wikipedia.org/wiki/Amino_acid#Table_of_standard_amino_acid_abbreviations_and_properties var aminoAcidsAlphabet = []rune("ACDEFGHIJLMNPQRSTVWY") - rand.Seed(seed) + randomSource := rand.New(rand.NewSource(seed)) randomSequence := make([]rune, length) @@ -31,7 +31,7 @@ func ProteinSequence(length int, seed int64) (string, error) { //* is the standard abbreviation for the stop codon. That's a signal for the ribosome to stop the translation and because of that a protein sequence is finished with * randomSequence[peptide] = '*' } else { - randomIndex := rand.Intn(len(aminoAcidsAlphabet)) + randomIndex := randomSource.Intn(len(aminoAcidsAlphabet)) randomSequence[peptide] = aminoAcidsAlphabet[randomIndex] } }