Closed kannae97 closed 6 days ago
gomonkey is not concurrent safe, try xgo if you need concurrent safety: https://github.com/xhd2015/xgo
gomonkey is not concurrent safe, try xgo if you need concurrent safety: https://github.com/xhd2015/xgo
Thank u, bro.
@kannae97 This has nothing to do with thread safety. When using sequence patches, ensure the sequence length is at least equal to the number of calls; otherwise, it will panic. Sequence patches emphasize that the return value differs with each call. In this case, the sequence patch length is 1, so using the sequence patch API is meaningless. Using the regular patch API is sufficient since the return value is the same for each call, with no call count limit.
Like this:
panic: double seq is less than call seq [recovered] panic: double seq is less than call seq