This reproduces with Staticcheck 2020.1.4 (built into gopls), go version is go1.14.1 darwin/amd64.
Repro:
package main
import "time"
type embedTime struct {
time.Time
}
func main() {
t := embedTime{}
t.Sub(time.Now())
}
The suggested fix will convert t.Sub(time.Now()) to time.Until(t), which does not compile. The correct fix would be time.Until(t.Time).
This reproduces with Staticcheck 2020.1.4 (built into
gopls),go versionisgo1.14.1 darwin/amd64.Repro:
The suggested fix will convert
t.Sub(time.Now())totime.Until(t), which does not compile. The correct fix would betime.Until(t.Time).