uber-go / goleak

Goroutine leak detector
MIT License
4.48k stars 148 forks source link

goleak is no longer compatible with Go 1.5+ #85

Closed Syuparn closed 1 year ago

Syuparn commented 1 year ago

Readme explains this is compatible with Go 1.5+. However, the latest version v1.2.0 only works on Go 1.18+.

Sample code:

package main

import (
    "testing"

    "go.uber.org/goleak"
)

func TestLeak(t *testing.T) {
    defer goleak.VerifyNone(t)
}
$ go version
go version go1.13.15 linux/amd64
$ go test
# go.uber.org/goleak
/go/pkg/mod/go.uber.org/goleak@v1.2.0/options.go:115:3: undefined: isTraceStack
note: module requires Go 1.18
FAIL    example.com/foo [build failed]

The previous version v1.1.12 works expectedly. This seems due to https://github.com/uber-go/goleak/pull/79. Is current version only compatible with Go 1.18+?

rabbbit commented 1 year ago

We follow the Go release policy: https://go.dev/doc/devel/release#policy

Each major Go release is supported until there are two newer major releases. For example, Go 1.5 was supported until the Go 1.7 release, and Go 1.6 was supported until the Go 1.8 release.

You'll need to upgrade or stick with v1.1.12 in the meantime.

I'll update the Readme.

Syuparn commented 1 year ago

@rabbbit

I see. Thank you for your reply!