Skip to content

x/vuln/cmd/govulncheck: v1.1.0: Fatal error when used in a workspace #66863

Closed as not planned
@nicholascapo

Description

@nicholascapo

govulncheck version

Go: go1.22.2
Scanner: govulncheck@v1.1.0
DB: https://vuln.go.dev
DB updated: 2024-04-16 21:40:19 +0000 UTC

Does this issue reproduce at the latest version of golang.org/x/vuln?

Yes

Output of go env in your module/workspace:

GO111MODULE=''
GOARCH='amd64'
GOBIN=''
GOCACHE='/home/nicholas/.cache/go-build'
GOENV='/home/nicholas/.config/go/env'
GOEXE=''
GOEXPERIMENT=''
GOFLAGS=''
GOHOSTARCH='amd64'
GOHOSTOS='linux'
GOINSECURE=''
GOMODCACHE='/home/nicholas/go/pkg/mod'
GONOPROXY=''
GONOSUMDB=''
GOOS='linux'
GOPATH='/home/nicholas/go'
GOPRIVATE=''
GOPROXY='https://proxy.golang.org,direct'
GOROOT='/usr/lib/go-1.22'
GOSUMDB='sum.golang.org'
GOTMPDIR=''
GOTOOLCHAIN='auto'
GOTOOLDIR='/usr/lib/go-1.22/pkg/tool/linux_amd64'
GOVCS=''
GOVERSION='go1.22.2'
GCCGO='gccgo'
GOAMD64='v1'
AR='ar'
CC='gcc'
CXX='g++'
CGO_ENABLED='1'
GOMOD='/dev/null'
GOWORK='/home/nicholas/src/demo/example/go.work'
CGO_CFLAGS='-O2 -g'
CGO_CPPFLAGS=''
CGO_CXXFLAGS='-O2 -g'
CGO_FFLAGS='-O2 -g'
CGO_LDFLAGS='-O2 -g'
PKG_CONFIG='pkg-config'
GOGCCFLAGS='-fPIC -m64 -pthread -Wl,--no-gc-sections -fmessage-length=0 -ffile-prefix-map=/tmp/go-build2849136563=/tmp/go-build -gno-record-gcc-switches'

What did you do?

Construct a workspace like this:

$ tree
.
├── go.work
└── pkg
    ├── go.mod
    └── main.go

go.work

go 1.22.2

use ./pkg

pkg/go.mod

module example

go 1.22.2

pkg/main.go

package main

import "fmt"

func main() {
	fmt.Println("main")
}

Run govulncheck

$ govulncheck ./pkg/...

What did you see happen?

govulncheck: no go.mod file

govulncheck only works with Go modules. Try navigating to your module directory.
Otherwise, run go mod init to make your project a module.

See https://go.dev/doc/modules/managing-dependencies for more information.

What did you expect to see?

Scanning your code and 45 packages across 1 dependent module for known vulnerabilities...

No vulnerabilities found.

Metadata

Metadata

Assignees

Labels

WaitingForInfoIssue is not actionable because of missing required information, which needs to be provided.vulncheck or vulndbIssues for the x/vuln or x/vulndb repo

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions