程式語言 - Golang - 解決Cannot load io/fs: malformed module path io/fs問題



參考資訊:
https://go.dev/doc/install
https://github.com/DefectDojo/godojo/issues/31

問題如下:

build github.com/falcosecurity/plugins/plugins/k8saudit/plugin: cannot load io/fs: malformed module path "io/fs": missing dot in first path element
make: *** [Makefile:46: libk8saudit.so] Error 1

解法如下(安裝1.16版本以上的golang):

$ cd
$ wget https://go.dev/dl/go1.21.0.linux-amd64.tar.gz
$ sudo rm -rf /usr/local/go
$ sudo tar -C /usr/local -xzf go1.21.0.linux-amd64.tar.gz
$ export PATH=/usr/local/go/bin:$PATH