google / log4jscanner

A log4j vulnerability filesystem scanner and Go package for analyzing JAR files.
Apache License 2.0
1.57k stars 120 forks source link

"cannot find package" when building or installing through go install command #32

Closed ForumPlayer closed 2 years ago

ForumPlayer commented 2 years ago

When I try to build with go build -o log4jscanner, I always get this:

log4jscanner.go:26:2: cannot find package "github.com/google/log4jscanner/jar" in any of:
        /usr/lib/go-1.10/src/github.com/google/log4jscanner/jar (from $GOROOT)
        /home/fp/go/src/github.com/google/log4jscanner/jar (from $GOPATH)
log4jscanner_linux.go:22:2: cannot find package "golang.org/x/sys/unix" in any of:
        /usr/lib/go-1.10/src/golang.org/x/sys/unix (from $GOROOT)
        /home/fp/go/src/golang.org/x/sys/unix (from $GOPATH)
log4jscanner.go:21:2: cannot find package "io/fs" in any of:
        /usr/lib/go-1.10/src/io/fs (from $GOROOT)
        /home/fp/go/src/io/fs (from $GOPATH)

but if I try to install through go install github.com/google/log4jscanner@latest

can't load package: package github.com/google/log4jscanner@latest: cannot find package "github.com/google/log4jscanner@latest" in any of:
        /usr/lib/go-1.10/src/github.com/google/log4jscanner@latest (from $GOROOT)
        /home/fp/go/src/github.com/google/log4jscanner@latest (from $GOPATH)

I'm using elementary OS 5.1.7 (based on Ubuntu 18.04.6 LTS), and my go installation is basically only those packages:

golang-go/bionic,now 2:1.10~4ubuntu1 amd64 [installed]
golang-1.10-go/bionic-security,bionic-updates,now 1.10.4-2ubuntu1~18.04.2 amd64 [installed,automatic]
golang-1.10-race-detector-runtime/bionic,now 0.0+svn285455-0ubuntu1 amd64 [installed,automatic]
golang-1.10-src/bionic-security,bionic-updates,now 1.10.4-2ubuntu1~18.04.2 amd64 [installed,automatic]
golang-docker-credential-helpers/bionic-updates,now 0.5.0-2ubuntu0.1 amd64 [installed,automatic]
golang-race-detector-runtime/bionic,now 2:1.10~4ubuntu1 amd64 [installed,automatic]
golang-src/bionic,now 2:1.10~4ubuntu1 amd64 [installed,automatic]
ericchiang commented 2 years ago

This project uses features from go1.17. you'll need to update your go installation and use modules to build from source

https://go.dev/ref/mod