You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm not sure if it's just my usage problem.
The test package did not use the go test command, so the variable fullPath was not initialized.
Finally, it crashes when the assertion is wrong.
The possible reasons are as follows:
if file != "" {
if *fullPath {
// If relative path, truncate file name at last file name separator.
} else if index := strings.LastIndexAny(file, `/\`); index >= 0 {
file = file[index+1:]
}
} else {
file = "???"
}
The text was updated successfully, but these errors were encountered:
Go version
go version go1.22.7 linux/amd64
Output of
go env
in your module/workspace:What did you do?
What did you see happen?
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x4c0460]
goroutine 1 [running]:
testing.(*common).decorate(0x7ff35d8668c8?, {0xc000200540, 0x1b7}, 0x1c0?)
/usr/local/go/src/testing/testing.go:777 +0xa0
testing.(*common).logDepth(0xc0001384e0, {0xc000200540, 0x1b7}, 0x3)
/usr/local/go/src/testing/testing.go:1044 +0x1dd
testing.(*common).log(...)
/usr/local/go/src/testing/testing.go:1013
testing.(*common).Errorf(0xc0001384e0, {0x58d565?, 0x40b845?}, {0xc000014370?, 0x55af60?, 0x101?})
/usr/local/go/src/testing/testing.go:1077 +0x54
github.com/stretchr/testify/assert.Fail({0x5e14e0, 0xc0001384e0}, {0xc0000242a0, 0x59}, {0xc00018ff20, 0x1, 0x1})
/root/go/pkg/mod/github.com/stretchr/[email protected]/assert/assertions.go:363 +0x370
github.com/stretchr/testify/assert.EqualValues({0x5e14e0, 0xc0001384e0}, {0x55a960, 0x5e0868}, {0x55a960, 0x5e0878}, {0xc00018ff20, 0x1, 0x1})
/root/go/pkg/mod/github.com/stretchr/[email protected]/assert/assertions.go:587 +0x1fd
main.main()
/assert_rdg/main.go:12 +0x5f
What did you expect to see?
I'm not sure if it's just my usage problem.
The test package did not use the go test command, so the variable fullPath was not initialized.
Finally, it crashes when the assertion is wrong.
The possible reasons are as follows:
The text was updated successfully, but these errors were encountered: