This error message is indicating that there is a problem with the use of the 'append' function in Go. Specifically, it is telling you that the function is copying a lock value, which can cause issues with synchronization.

The root cause of this issue is that the type 'pb.OrderListDetails' contains a field of type 'protoimpl.MessageState', which in turn contains a field of type 'sync.Mutex'. This 'Mutex' is a synchronization primitive that is used to protect access to shared resources.

However, when you call the 'append' function on a slice of 'pb.OrderListDetails', it creates a new slice with a new underlying array. This means that the 'Mutex' value is also copied, which can cause issues with synchronization.

To fix this issue, you may need to modify the design of your code to avoid copying the lock value. You could consider using a different synchronization primitive that is more suitable for use with slices, such as a 'sync.RWMutex'. Alternatively, you could modify the 'pb.OrderListDetails' type to remove the 'MessageState' field, or find a way to copy it more safely

golandCall of append copies lock value type pbOrderListDetails contains protoimplMessageState contains syncMutex which is syncLocker

原文地址: https://www.cveoy.top/t/topic/g8Ap 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录