spf13 / afero

A FileSystem Abstraction System for Go
Apache License 2.0
5.8k stars 498 forks source link

v1.9.0 Can't build on go 1.15.14: Download error package io/fs is not in GOROOT #370

Closed joernott closed 1 year ago

joernott commented 2 years ago

I just tried updating and installing a tool using cobra and viper and I got the following error on a redhat linux 7 using go 1.15.14 from the golang-bin package from EPEL (golang-bin-1.15.14-1):

../../../../go/pkg/mod/github.com/spf13/afero@v1.9.0/basepath.go:4:2: package io/fs is not in GOROOT (/usr/lib/golang/src/io/fs)

Updating to golang 1.16.13 or 1.17.10 from epel solves the problem for me. I had no problems on Windows with 1.16 to 1.18 (sadly, I had no Windows with 1.15 available)

jxsl13 commented 2 years ago

The problem is that io/fs was introduced in go 1.16, meaning you need to update your lowest supported Go version to 1.16.

It is to be expected and not really a bug in that sense.

joernott commented 1 year ago

OK, I just wanted to make sure, that this was not an accident, as this also impacts cobra and viper. A minimal version of 1.16 is quite reasonable, so I'll close this ticket.