d4x1 commented on PR #4662:
URL: 
https://github.com/apache/incubator-devlake/pull/4662#issuecomment-1471382510

   Agreed! These two functions do the same thing. Of course them can be merged 
and moved to `core/utils`.
   But after doing that, I think there are some options to deal with it.
   1.  without `init` function where we can do `rand.Seed` in,  and use 
`rand.Int` directly in `RandSomeStr`. this will change the original behavior.
   2. without `init` function where we can do `rand.Seed` in, and use 
`rand.New(rand.NewSource)` in `RandSomeStr`.  This will be inefficient.
   3. add `init` function, we can  do `rand.Seed` in it, and  `rand.Int` in 
`RandSomeStr`, add some comments.
   
   
   I think 1 and 2 are the right way. 3 is temporary and outdated.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to