google / go-licenses

A lightweight tool to report on the licenses used by a Go package and its dependencies. Highlight! Versioned external URL to licenses can be found at the same time.
Apache License 2.0
824 stars 125 forks source link

Fix vendored build #192

Closed SuperSandro2000 closed 2 months ago

SuperSandro2000 commented 1 year ago

Before when running go mod vendor and then go build the following error would be produced:

$ go build ./... vendor/golang.org/x/sys/unix/syscall.go:83:16: unsafe.Slice requires go1.17 or later (-lang was set to go1.16; check go.mod) vendor/golang.org/x/sys/unix/syscall_linux.go:2270:9: unsafe.Slice requires go1.17 or later (-lang was set to go1.16; check go.mod) vendor/golang.org/x/sys/unix/syscall_unix.go:118:7: unsafe.Slice requires go1.17 or later (-lang was set to go1.16; check go.mod) vendor/golang.org/x/sys/unix/sysvshm_unix.go:33:7: unsafe.Slice requires go1.17 or later (-lang was set to go1.16; check go.mod)

This is fixed by bumping the minimal go version and then running go mod tidy

Bobgy commented 1 year ago

Thank you for the PR! Does it fail without vendoring?

What is the purpose of go build ./...? Why is go build . not enough?

SuperSandro2000 commented 1 year ago

Does it fail without vendoring?

Nope, only with it.

What is the purpose of go build ./...? Why is go build . not enough?

I was just being lazy, ./... should build everything. Same error.