Golang error report shows very little information, how to debug?

golang debugging shows very little information, so how to debug? For example, the following compilation error is reported:

[root@vagrant-dev web]-sharp go run main.go
panic: invalid sql type  (slice) for mysql

goroutine 1 [running]:
github.com/jinzhu/gorm.(*mysql).DataTypeOf(0xc00000c440, 0xc00031e690, 0x9, 0x9a9258)
    /var/www/go_work/src/github.com/jinzhu/gorm/dialect_mysql.go:121 +0xd03
github.com/jinzhu/gorm.(*Scope).createTable(0xc0002fe500, 0x9aab38)
    /var/www/go_work/src/github.com/jinzhu/gorm/scope.go:1156 +0x288
github.com/jinzhu/gorm.(*Scope).autoMigrate(0xc0002fe500, 0x93da60)
    /var/www/go_work/src/github.com/jinzhu/gorm/scope.go:1252 +0x3cf
github.com/jinzhu/gorm.(*DB).AutoMigrate(0xc00028ab00, 0xc0001c5f58, 0x1, 0x1, 0xc0003020b0)
    /var/www/go_work/src/github.com/jinzhu/gorm/main.go:596 +0x88
main.main()
    /var/www/go_work/src/apiserver/cmd/web/main.go:27 +0x172
exit status 2

just said one sentence: where is the invalid sql style,? What debugging tool should I use?

Jan.19,2022

/ var/www/go_work/src/apiserver/cmd/web/main.go:27 + 0x172 has a provenance ~ see if there is a problem with writing it. ~


should be query, .Find, for example, if you declare data: = [] xxxx {}
then you should. Find (& data)
you try


1.Google good;
2. Generally speaking, when using open source libraries, it is more accurate to find issue on github;
3. Debug using dlv;


go's prompt is clear enough to return directly to the stack. If you look at the stack, you'll probably know where something went wrong

.
Menu