owasp-amass / oam-tools

Analysis and management tools for an Open Asset Model database
Apache License 2.0
37 stars 9 forks source link

go.mod:5: unknown directive: toolchain #6

Open spirovskib opened 7 months ago

spirovskib commented 7 months ago

Running on Mac M1, Sonoma 14.3.

go version: go version go1.20.2 darwin/arm64

Error received:

% go install -v github.com/owasp-amass/oam-tools/cmd/oam_subs@master
go: github.com/owasp-amass/oam-tools/cmd/oam_subs@master (in github.com/owasp-amass/oam-tools@v0.1.3-0.20240121185119-d7add1144434): go.mod:5: unknown directive: toolchain
ppfeister commented 6 months ago

Encountered this myself on an Alma server.

The toolchain directive wasn't added until version 1.21. Unfortunately, it might take a while for this to trickle down into official repositories.

Take your pick. I recommend Option 2.

Option 1: Upgrading to 1.22.0

Manually install a more recent version of go. The golang website describes how over here. Not too difficult, but Option 2 is still easier.

Option 2: Installing 1.22.0 alongside 1.20.2

go install golang.org/dl/go1.22.0@latest
go1.22.0 download
go1.22.0 install -v github.com/owasp-amass/oam-tools/cmd/...@master

Of course, ... will install all three tools. Substitute for oam_subs if that's all you need.