# Test for a crash in go fmt on invalid input when using modules.
# Issue 26792.

env GO111MODULE=on
! go fmt x.go
! stderr panic

-- go.mod --
module x

-- x.go --
// Missing package declaration.
var V int
