Skip to content

Commit 05d6c88

Browse files
authored
errors: improve error message for unsupported Go versions (#118)
The error message now suggests running `go get github.com/DataDog/go-libddwaf@latest` to help users troubleshoot the issue when they are running a yet-to-be supported Go release.
1 parent 41059e9 commit 05d6c88

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

errors/support.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,10 @@ func (e UnsupportedOSArchError) Error() string {
2626
type UnsupportedGoVersionError struct{}
2727

2828
func (e UnsupportedGoVersionError) Error() string {
29-
return fmt.Sprintf("unsupported Go version: %s", runtime.Version())
29+
return fmt.Sprintf(
30+
"unsupported Go version: %s (try running `go get github.com/DataDog/go-libddwaf@latest`)",
31+
runtime.Version(),
32+
)
3033
}
3134

3235
type CgoDisabledError struct{}

0 commit comments

Comments
 (0)