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
- 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 compare the equality of structures in golang
- How to use C + + function pointer array
- mysql error 1062
- How to solve MySQL error 1049 (42000): unknown database ‘database’
- Nucleus plus protection mechanism (based on ARM processor)
- panic: runtime error: index out of range
- Two dimensional array and pointer to one dimensional array
- Troubleshooting of Jenkins upgrade to 2.42 JUnit test report
- Error analysis of queryformap method of jdbctemplate
- Txt import MySQL: error 1062 (23000): duplicate entry ‘0’ for key ‘primary’
- Kali Linux exploit failed [unreachable]: Rex: connectiontimeout solution
- Memory error unhandled exception: 0xc0000005: read location: 0x00000
- Linux uses open source Yum to report error performing checksums