Go test, report an error;
Error in go test panic: reflect: reflect. Value. Set using addressable value [recovered].
Solution: generally, there is an error of using unaddressable value, which indicates that the pointer value passed is incorrect. For example, if the pointer address needs to be passed, but the value is passed. At that time, I had a hunch that DB should have passed a non pointer when finding. After verification, it was.
So, the summary is: when updating in Gorm, you can not pass the pointer (if you want to use the returned primary key, you still need to pass the pointer), but when querying, you must pass it, even if it is slice or map type.
- Error in dev C + + running pointer
- After the go pointer is declared and assigned, a panic: runtime error: invalid memory address or nil pointer reference appears
- Common causes of Leetcode Runtime Error
- Golang MySQL error SQL: unknown driver “MySQL” (Forgotten import?) solution
- An error occurs when pymysql uses% d to pass in parameters
- Attributeerror: object has no attribute
- The solution of Hibernate query returning all null lists
- Eclipse run main method error: a JNI error has occurred, please check your installation and try again
- How to use C + + function pointer array
- How to compare the equality of structures in golang
- mysql error 1062
- Nucleus plus protection mechanism (based on ARM processor)
- How to solve MySQL error 1049 (42000): unknown database ‘database’
- Two dimensional array and pointer to one dimensional array
- panic: runtime error: index out of range
- Txt import MySQL: error 1062 (23000): duplicate entry ‘0’ for key ‘primary’
- Debug error: abort() has been called error causes and Solutions
- Troubleshooting of Jenkins upgrade to 2.42 JUnit test report
- Memory error unhandled exception: 0xc0000005: read location: 0x00000
- Error analysis of queryformap method of jdbctemplate